diff options
author | 2009-01-03 15:31:03 +0000 | |
---|---|---|
committer | 2009-01-03 15:31:03 +0000 | |
commit | bd33d999ef1da0b6bafa896334bc486dda1b8e69 (patch) | |
tree | 8c9c651d50c08c4cbe861324f9d0cf540464a3b4 | |
parent | Attach agp(4) to the Intel 946GZ integrated video. (diff) | |
download | wireguard-openbsd-bd33d999ef1da0b6bafa896334bc486dda1b8e69.tar.xz wireguard-openbsd-bd33d999ef1da0b6bafa896334bc486dda1b8e69.zip |
Write back the priority the kernel used. Fixes a problem seen in ospfd when
routes are added via route(8) -- those where added with the wrong priority
and so where not correctly tracked later on.
Found and tested by gollo@
-rw-r--r-- | sys/net/rtsock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 66328b883ca..60752027e7a 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.79 2008/12/12 21:52:04 claudio Exp $ */ +/* $OpenBSD: rtsock.c,v 1.80 2009/01/03 15:31:03 claudio Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -255,7 +255,7 @@ route_output(struct mbuf *m, ...) } } - /* make sure that kernel only bits are not set */ + /* make sure that kernel-only bits are not set */ rtm->rtm_priority &= RTP_MASK; if (rtm->rtm_priority != 0) { @@ -271,6 +271,9 @@ route_output(struct mbuf *m, ...) else prio = RTP_DEFAULT; + /* write back the priority the kernel used */ + rtm->rtm_priority = prio; + bzero(&info, sizeof(info)); info.rti_addrs = rtm->rtm_addrs; rt_xaddrs(rtm->rtm_hdrlen + (caddr_t)rtm, len + (caddr_t)rtm, &info); |