summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-05-31 03:27:17 +0000
committerclaudio <claudio@openbsd.org>2009-05-31 03:27:17 +0000
commita27b10fa1c5beb201553b7db5b4321f80a03fcb4 (patch)
treec582619226c47816469b73337865109da75eca07
parentMove task register restore code to proper place. (diff)
downloadwireguard-openbsd-a27b10fa1c5beb201553b7db5b4321f80a03fcb4.tar.xz
wireguard-openbsd-a27b10fa1c5beb201553b7db5b4321f80a03fcb4.zip
Fix for the rtfree 2 panic seen by some people before the release. A missing
refcnt bump caused the panic to be triggered. While there also make the priority so that the compare is working a bit better. henning@ cries in agony (I already gave up)
-rw-r--r--sys/net/rtsock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index d0a9e3cf5cc..dd1a54c03fa 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.85 2009/04/18 10:45:47 michele Exp $ */
+/* $OpenBSD: rtsock.c,v 1.86 2009/05/31 03:27:17 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -501,8 +501,10 @@ route_output(struct mbuf *m, ...)
/* first find correct priority bucket */
rn = rn_mpath_prio(rn, prio);
rt = (struct rtentry *)rn;
- if (prio != RTP_ANY && rt->rt_priority != prio) {
+ if (prio != RTP_ANY &&
+ (rt->rt_priority & RTP_MASK) != prio) {
error = ESRCH;
+ rt->rt_refcnt++;
goto flush;
}