diff options
author | hsu <hsu@FreeBSD.org> | 2002-12-22 05:35:03 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-12-22 05:35:03 +0000 |
commit | 82e1e3bab0d3abe1018a0b56559c154485f2f676 (patch) | |
tree | d0f9ee7e6f9d8014e6f8f94ab6965e85c268792e /sys/netipsec | |
parent | 2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (diff) | |
download | FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.zip FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.tar.gz |
SMP locking for ifnet list.
Diffstat (limited to 'sys/netipsec')
-rw-r--r-- | sys/netipsec/xform_ipip.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netipsec/xform_ipip.c b/sys/netipsec/xform_ipip.c index a9c0edb..9d49a3e 100644 --- a/sys/netipsec/xform_ipip.c +++ b/sys/netipsec/xform_ipip.c @@ -309,6 +309,7 @@ _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) if ((m->m_pkthdr.rcvif == NULL || !(m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK)) && ipip_allow != 2) { + IFNET_RLOCK(); for (ifp = ifnet.tqh_first; ifp != 0; ifp = ifp->if_list.tqe_next) { for (ifa = ifp->if_addrlist.tqh_first; ifa != 0; @@ -325,6 +326,7 @@ _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) ipo->ip_src.s_addr) { ipipstat.ipips_spoof++; m_freem(m); + IFNET_RUNLOCK(); return; } } @@ -341,6 +343,7 @@ _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &ip6->ip6_src)) { ipipstat.ipips_spoof++; m_freem(m); + IFNET_RUNLOCK(); return; } @@ -348,6 +351,7 @@ _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) #endif /* INET6 */ } } + IFNET_RUNLOCK(); } /* Statistics */ |