summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-01-13 09:38:36 +0000
committermpi <mpi@openbsd.org>2016-01-13 09:38:36 +0000
commit7cf86a87491938f8d6e8ad703d29f1b88da9ce91 (patch)
tree371cbd14468010920be62a8750f403f7f6a5abfb
parentMake 'ifconfig $if mode' a valid subcommand that works independently of (diff)
downloadwireguard-openbsd-7cf86a87491938f8d6e8ad703d29f1b88da9ce91.tar.xz
wireguard-openbsd-7cf86a87491938f8d6e8ad703d29f1b88da9ce91.zip
Prevent a double if_put().
ok mikeb@, bluhm@
-rw-r--r--sys/netinet/ip_output.c3
-rw-r--r--sys/netinet6/ip6_output.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 6dedd8789e6..070a56b6bd1 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.315 2015/12/05 10:52:26 tedu Exp $ */
+/* $OpenBSD: ip_output.c,v 1.316 2016/01/13 09:38:36 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -419,6 +419,7 @@ sendit:
m->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
ro = NULL;
if_put(ifp); /* drop reference since target changed */
+ ifp = NULL;
goto reroute;
}
#endif
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index bdd1728305b..61e0fa2b7ab 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.202 2015/12/03 10:34:24 tedu Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.203 2016/01/13 09:38:37 mpi Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -722,6 +722,7 @@ reroute:
finaldst = ip6->ip6_dst;
ro = NULL;
if_put(ifp); /* drop reference since destination changed */
+ ifp = NULL;
goto reroute;
}
#endif