version 1.333, 2016/07/04 08:10:50 |
version 1.338, 2016/07/26 08:34:55 |
Line 372 ip_match_our_address(struct ifnet *ifp, |
|
Line 372 ip_match_our_address(struct ifnet *ifp, |
|
checkif = ip_checkinterface && (ipforwarding == 0) && |
checkif = ip_checkinterface && (ipforwarding == 0) && |
(ifp->if_flags & IFF_LOOPBACK) == 0; |
(ifp->if_flags & IFF_LOOPBACK) == 0; |
|
|
LIST_FOREACH(ia, &IN_IFADDR_HASH(ip->ip_dst.s_addr), ia_hash) { |
IN_ADDRHASH_READER_FOREACH(ia, ip->ip_dst.s_addr) { |
if (in_hosteq(ia->ia_addr.sin_addr, ip->ip_dst)) { |
if (in_hosteq(ia->ia_addr.sin_addr, ip->ip_dst)) { |
if (ia->ia4_flags & IN_IFF_NOTREADY) |
if (ia->ia4_flags & IN_IFF_NOTREADY) |
continue; |
continue; |
Line 381 ip_match_our_address(struct ifnet *ifp, |
|
Line 381 ip_match_our_address(struct ifnet *ifp, |
|
if ((ia->ia_ifp->if_flags & IFF_UP) != 0) |
if ((ia->ia_ifp->if_flags & IFF_UP) != 0) |
break; |
break; |
else |
else |
downmatch++; |
(*downmatch)++; |
} |
} |
} |
} |
|
|
Line 394 ip_match_our_address_broadcast(struct if |
|
Line 394 ip_match_our_address_broadcast(struct if |
|
struct in_ifaddr *ia = NULL; |
struct in_ifaddr *ia = NULL; |
struct ifaddr *ifa; |
struct ifaddr *ifa; |
|
|
IFADDR_FOREACH(ifa, ifp) { |
IFADDR_READER_FOREACH(ifa, ifp) { |
if (ifa->ifa_addr->sa_family != AF_INET) |
if (ifa->ifa_addr->sa_family != AF_INET) |
continue; |
continue; |
ia = ifatoia(ifa); |
ia = ifatoia(ifa); |
Line 469 ip_input(struct mbuf *m) |
|
Line 469 ip_input(struct mbuf *m) |
|
* are receiving, can't do anything with incoming packets yet. |
* are receiving, can't do anything with incoming packets yet. |
* Note: we pre-check without locks held. |
* Note: we pre-check without locks held. |
*/ |
*/ |
if (!TAILQ_FIRST(&in_ifaddrhead)) { |
if (IN_ADDRLIST_READER_EMPTY()) |
goto out; |
goto out; |
} |
|
IP_STATINC(IP_STAT_TOTAL); |
IP_STATINC(IP_STAT_TOTAL); |
|
|
/* |
/* |
Line 1473 ip_savecontrol(struct inpcb *inp, struct |
|
Line 1472 ip_savecontrol(struct inpcb *inp, struct |
|
if (inpflags & INP_RECVIF) { |
if (inpflags & INP_RECVIF) { |
struct sockaddr_dl sdl; |
struct sockaddr_dl sdl; |
|
|
sockaddr_dl_init(&sdl, sizeof(sdl), ifp ? |
sockaddr_dl_init(&sdl, sizeof(sdl), ifp->if_index, 0, NULL, 0, |
ifp->if_index : 0, 0, NULL, 0, NULL, 0); |
NULL, 0); |
*mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); |
*mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); |
if (*mp) |
if (*mp) |
mp = &(*mp)->m_next; |
mp = &(*mp)->m_next; |