diff options
author | 2016-01-22 11:14:58 +0000 | |
---|---|---|
committer | 2016-01-22 11:14:58 +0000 | |
commit | bfc6c8bdfdedddd766f63358abdf6ca1a9edaceb (patch) | |
tree | a6598e6f3eef134faad29869a1249671d219ab48 | |
parent | fix a missing if_put() in the default af path of tcp_mss() (diff) | |
download | wireguard-openbsd-bfc6c8bdfdedddd766f63358abdf6ca1a9edaceb.tar.xz wireguard-openbsd-bfc6c8bdfdedddd766f63358abdf6ca1a9edaceb.zip |
add a missing if_put() to ipip_input()
ok mpi@
-rw-r--r-- | sys/netinet/ip_ipip.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c index 145e4bbdd90..a4878d72143 100644 --- a/sys/netinet/ip_ipip.c +++ b/sys/netinet/ip_ipip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipip.c,v 1.67 2015/09/11 07:42:35 claudio Exp $ */ +/* $OpenBSD: ip_ipip.c,v 1.68 2016/01/22 11:14:58 jsg Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -293,8 +293,9 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp, int proto) } /* Check for local address spoofing. */ - if (((ifp = if_get(m->m_pkthdr.ph_ifidx)) == NULL || - !(ifp->if_flags & IFF_LOOPBACK)) && ipip_allow != 2) { + ifp = if_get(m->m_pkthdr.ph_ifidx); + if (((ifp == NULL) || !(ifp->if_flags & IFF_LOOPBACK)) && + ipip_allow != 2) { struct sockaddr_storage ss; struct rtentry *rt; @@ -324,7 +325,9 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp, int proto) return; } rtfree(rt); - } + } else { + if_put(ifp); + } /* Statistics */ ipipstat.ipips_ibytes += m->m_pkthdr.len - iphlen; |