diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-01-03 15:31:04 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-01-03 15:31:04 +0000 |
commit | 698c228268bd8e81151296c4d12c3752d06e166d (patch) | |
tree | 99ba22f254e392ee045a596e585ed671df53e863 /sys | |
parent | 777bdbba91f3f2e16d94842748722ad229c6a402 (diff) |
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@
Diffstat (limited to 'sys')
-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); |