version 1.302.2.4, 2017/12/03 11:39:04 |
version 1.358, 2017/07/08 22:56:15 |
Line 371 ip_match_our_address(struct ifnet *ifp, |
|
Line 371 ip_match_our_address(struct ifnet *ifp, |
|
continue; |
continue; |
if (checkif && ia->ia_ifp != ifp) |
if (checkif && ia->ia_ifp != ifp) |
continue; |
continue; |
if ((ia->ia_ifp->if_flags & IFF_UP) == 0) { |
if ((ia->ia_ifp->if_flags & IFF_UP) != 0 && |
|
(ia->ia4_flags & IN_IFF_DETACHED) == 0) |
|
break; |
|
else |
(*downmatch)++; |
(*downmatch)++; |
continue; |
|
} |
|
if (ia->ia4_flags & IN_IFF_DETACHED && |
|
(ifp->if_flags & IFF_LOOPBACK) == 0) |
|
continue; |
|
break; |
|
} |
} |
} |
} |
|
|
Line 395 ip_match_our_address_broadcast(struct if |
|
Line 392 ip_match_our_address_broadcast(struct if |
|
if (ifa->ifa_addr->sa_family != AF_INET) |
if (ifa->ifa_addr->sa_family != AF_INET) |
continue; |
continue; |
ia = ifatoia(ifa); |
ia = ifatoia(ifa); |
if (ia->ia4_flags & IN_IFF_NOTREADY) |
if (ia->ia4_flags & (IN_IFF_NOTREADY | IN_IFF_DETACHED)) |
continue; |
|
if (ia->ia4_flags & IN_IFF_DETACHED && |
|
(ifp->if_flags & IFF_LOOPBACK) == 0) |
|
continue; |
continue; |
if (in_hosteq(ip->ip_dst, ia->ia_broadaddr.sin_addr) || |
if (in_hosteq(ip->ip_dst, ia->ia_broadaddr.sin_addr) || |
in_hosteq(ip->ip_dst, ia->ia_netbroadcast) || |
in_hosteq(ip->ip_dst, ia->ia_netbroadcast) || |
Line 432 ipintr(void *arg __unused) |
|
Line 426 ipintr(void *arg __unused) |
|
|
|
KASSERT(cpu_softintr_p()); |
KASSERT(cpu_softintr_p()); |
|
|
SOFTNET_LOCK_UNLESS_NET_MPSAFE(); |
#ifndef NET_MPSAFE |
|
mutex_enter(softnet_lock); |
|
#endif |
while ((m = pktq_dequeue(ip_pktq)) != NULL) { |
while ((m = pktq_dequeue(ip_pktq)) != NULL) { |
ip_input(m); |
ip_input(m); |
} |
} |
SOFTNET_UNLOCK_UNLESS_NET_MPSAFE(); |
#ifndef NET_MPSAFE |
|
mutex_exit(softnet_lock); |
|
#endif |
} |
} |
|
|
/* |
/* |
Line 754 ip_input(struct mbuf *m) |
|
Line 752 ip_input(struct mbuf *m) |
|
return; |
return; |
} |
} |
#ifdef IPSEC |
#ifdef IPSEC |
/* Check the security policy (SP) for the packet */ |
/* Perform IPsec, if any. */ |
if (ipsec_used) { |
if (ipsec_used) { |
|
SOFTNET_LOCK(); |
if (ipsec4_input(m, IP_FORWARDING | |
if (ipsec4_input(m, IP_FORWARDING | |
(ip_directedbcast ? IP_ALLOWBROADCAST : 0)) != 0) { |
(ip_directedbcast ? IP_ALLOWBROADCAST : 0)) != 0) { |
|
SOFTNET_UNLOCK(); |
goto out; |
goto out; |
} |
} |
|
SOFTNET_UNLOCK(); |
} |
} |
#endif |
#endif |
ip_forward(m, srcrt, ifp); |
ip_forward(m, srcrt, ifp); |
|
|
*/ |
*/ |
if (ipsec_used && |
if (ipsec_used && |
(inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0) { |
(inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0) { |
|
SOFTNET_LOCK(); |
if (ipsec4_input(m, 0) != 0) { |
if (ipsec4_input(m, 0) != 0) { |
|
SOFTNET_UNLOCK(); |
goto out; |
goto out; |
} |
} |
|
SOFTNET_UNLOCK(); |
} |
} |
#endif |
#endif |
|
|
|
|
|
|
const int off = hlen, nh = ip->ip_p; |
const int off = hlen, nh = ip->ip_p; |
|
|
|
SOFTNET_LOCK(); |
(*inetsw[ip_protox[nh]].pr_input)(m, off, nh); |
(*inetsw[ip_protox[nh]].pr_input)(m, off, nh); |
|
SOFTNET_UNLOCK(); |
return; |
return; |
|
|
out: |
out: |
|
|
ip_slowtimo(void) |
ip_slowtimo(void) |
{ |
{ |
|
|
SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE(); |
#ifndef NET_MPSAFE |
|
mutex_enter(softnet_lock); |
|
KERNEL_LOCK(1, NULL); |
|
#endif |
|
|
ip_reass_slowtimo(); |
ip_reass_slowtimo(); |
|
|
SOFTNET_KERNEL_UNLOCK_UNLESS_NET_MPSAFE(); |
#ifndef NET_MPSAFE |
|
KERNEL_UNLOCK_ONE(NULL); |
|
mutex_exit(softnet_lock); |
|
#endif |
} |
} |
|
|
/* |
/* |