summaryrefslogtreecommitdiff
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-09-11 16:58:01 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-09-11 16:58:01 +0000
commitde0ae0e115858684c278009a66d3b8469c885c62 (patch)
tree2c31e905bfaf6b013822305de6f03c838b9c0c6d /sys/net/rtsock.c
parent0b5a4152d931d130356f85d2682762c2ccba1b1f (diff)
Introduce rtref(9) use it in rtable_lookup() before returning a route
entry. ok bluhm@, claudio@
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 291bc3e2be1..77adb3f9b0c 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.169 2015/08/24 22:11:33 mpi Exp $ */
+/* $OpenBSD: rtsock.c,v 1.170 2015/09/11 16:58:00 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -654,13 +654,13 @@ route_output(struct mbuf *m, ...)
*/
if (info.rti_info[RTAX_GATEWAY] == NULL &&
rtm->rtm_type != RTM_GET) {
+ rtfree(rt);
rt = NULL;
error = ESRCH;
goto flush;
}
}
#endif
- rt->rt_refcnt++;
/*
* RTM_CHANGE/LOCK need a perfect match, rn_lookup()