diff options
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/route.c | 8 | ||||
-rw-r--r-- | sys/net/rtsock.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index bd95a7378db..f8fa97ca62b 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.218 2015/08/17 09:41:24 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.219 2015/08/17 09:46:26 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1182,7 +1182,6 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct sockaddr *dst) error = rtrequest1(RTM_ADD, &info, prio, &nrt, rtableid); if (error == 0 && (rt = nrt) != NULL) { - rt->rt_refcnt--; if (rt->rt_ifa != ifa) { printf("%s: wrong ifa (%p) was (%p)\n", __func__, ifa, rt->rt_ifa); @@ -1202,8 +1201,9 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct sockaddr *dst) * userland that a new address has been added. */ if (flags & RTF_LOCAL) - rt_sendaddrmsg(nrt, RTM_NEWADDR); - rt_sendmsg(nrt, RTM_ADD, rtableid); + rt_sendaddrmsg(rt, RTM_NEWADDR); + rt_sendmsg(rt, RTM_ADD, rtableid); + rtfree(rt); } return (error); } diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 5183568d8d4..538f2c08cb8 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.166 2015/07/18 21:58:06 mpi Exp $ */ +/* $OpenBSD: rtsock.c,v 1.167 2015/08/17 09:46:26 mpi Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -598,11 +598,11 @@ route_output(struct mbuf *m, ...) if (error == 0 && saved_nrt) { rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, &saved_nrt->rt_rmx); - saved_nrt->rt_refcnt--; /* write back the priority the kernel used */ rtm->rtm_priority = saved_nrt->rt_priority & RTP_MASK; rtm->rtm_index = saved_nrt->rt_ifp->if_index; rtm->rtm_flags = saved_nrt->rt_flags; + rtfree(saved_nrt); } break; case RTM_DELETE: |