Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_mroute.c
Show First 20 Lines • Show All 914 Lines • ▼ Show 20 Lines | if (error) { | ||||
vifp->v_lcl_addr = vifcp->vifc_lcl_addr; | vifp->v_lcl_addr = vifcp->vifc_lcl_addr; | ||||
vifp->v_rmt_addr = vifcp->vifc_rmt_addr; | vifp->v_rmt_addr = vifcp->vifc_rmt_addr; | ||||
vifp->v_ifp = ifp; | vifp->v_ifp = ifp; | ||||
/* initialize per vif pkt counters */ | /* initialize per vif pkt counters */ | ||||
vifp->v_pkt_in = 0; | vifp->v_pkt_in = 0; | ||||
vifp->v_pkt_out = 0; | vifp->v_pkt_out = 0; | ||||
vifp->v_bytes_in = 0; | vifp->v_bytes_in = 0; | ||||
vifp->v_bytes_out = 0; | vifp->v_bytes_out = 0; | ||||
/* setup default IP ID */ | |||||
vifp->v_ip_id = ip_initid(); | |||||
/* Adjust numvifs up if the vifi is higher than numvifs */ | /* Adjust numvifs up if the vifi is higher than numvifs */ | ||||
if (V_numvifs <= vifcp->vifc_vifi) | if (V_numvifs <= vifcp->vifc_vifi) | ||||
V_numvifs = vifcp->vifc_vifi + 1; | V_numvifs = vifcp->vifc_vifi + 1; | ||||
VIF_UNLOCK(); | VIF_UNLOCK(); | ||||
CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__, | CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__, | ||||
▲ Show 20 Lines • Show All 1,576 Lines • ▼ Show 20 Lines | sizeof(pim_encap_pimhdr)); | ||||
ip_outer->ip_dst = rt->mfc_rp; | ip_outer->ip_dst = rt->mfc_rp; | ||||
/* | /* | ||||
* Copy the inner header TOS to the outer header, and take care of the | * Copy the inner header TOS to the outer header, and take care of the | ||||
* IP_DF bit. | * IP_DF bit. | ||||
*/ | */ | ||||
ip_outer->ip_tos = ip->ip_tos; | ip_outer->ip_tos = ip->ip_tos; | ||||
if (ip->ip_off & htons(IP_DF)) | if (ip->ip_off & htons(IP_DF)) | ||||
ip_outer->ip_off |= htons(IP_DF); | ip_outer->ip_off |= htons(IP_DF); | ||||
ip_fillid(ip_outer); | ip_fillid(ip_outer, &vifp->v_ip_id); | ||||
pimhdr = (struct pim_encap_pimhdr *)((caddr_t)ip_outer | pimhdr = (struct pim_encap_pimhdr *)((caddr_t)ip_outer | ||||
+ sizeof(pim_encap_iphdr)); | + sizeof(pim_encap_iphdr)); | ||||
*pimhdr = pim_encap_pimhdr; | *pimhdr = pim_encap_pimhdr; | ||||
/* If the iif crosses a border, set the Border-bit */ | /* If the iif crosses a border, set the Border-bit */ | ||||
if (rt->mfc_flags[vifi] & MRT_MFC_FLAGS_BORDER_VIF & V_mrt_api_config) | if (rt->mfc_flags[vifi] & MRT_MFC_FLAGS_BORDER_VIF & V_mrt_api_config) | ||||
pimhdr->flags |= htonl(PIM_BORDER_REGISTER); | pimhdr->flags |= htonl(PIM_BORDER_REGISTER); | ||||
mb_first->m_data += sizeof(pim_encap_iphdr); | mb_first->m_data += sizeof(pim_encap_iphdr); | ||||
▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines |