diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2011-01-06 14:50:12 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2011-01-06 14:50:12 +0000 |
commit | 4e051c06e53f9a350390ea893bc0c5362f37358e (patch) | |
tree | 3cf8f5be0290c0ad24817ea97e8bcf1f0ecb16e5 /sys/net/rtsock.c | |
parent | 8c62ce045861f4e3921e517d0f5e5e32e758364f (diff) |
dst my point to memory inside rt so move the check up before the
rtfree(rt). Without this the sp_protocol on RTM_DELETE is garbage
and rtsocket user that restrict the AF of the socket (like ospfd)
will not see a single one of the RTM_DELETE.
OK henning@, dlg@
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index f42e786297b..ee882ac2b24 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.112 2011/01/06 14:45:07 claudio Exp $ */ +/* $OpenBSD: rtsock.c,v 1.113 2011/01/06 14:50:11 claudio Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -874,6 +874,8 @@ flush: rtm->rtm_flags |= RTF_DONE; } } + if (dst) + route_proto.sp_protocol = dst->sa_family; if (rt) rtfree(rt); @@ -893,8 +895,6 @@ fail: } if (rp) rp->rcb_proto.sp_family = 0; /* Avoid us */ - if (dst) - route_proto.sp_protocol = dst->sa_family; if (rtm) { m_copyback(m, 0, rtm->rtm_msglen, rtm, M_NOWAIT); if (m->m_pkthdr.len < rtm->rtm_msglen) { |