diff options
author | 2017-02-28 10:16:38 +0000 | |
---|---|---|
committer | 2017-02-28 10:16:38 +0000 | |
commit | f68d43e61852b7ef3a33beaf1f13bb9595e8e9ab (patch) | |
tree | a7dbf4f4ad002e702a36991eb4407402e4a9d7fa | |
parent | Some refactoring in ip6_input() needed to un-KERNEL_LOCK() the IPv6 (diff) | |
download | wireguard-openbsd-f68d43e61852b7ef3a33beaf1f13bb9595e8e9ab.tar.xz wireguard-openbsd-f68d43e61852b7ef3a33beaf1f13bb9595e8e9ab.zip |
Use rtable_match() rather than rtalloc(9) when adding a new route.
rtalloc(9) should be reserved for the hot path otherwise it's hard
to interpret the value of the 'use' counter.
ok claudio@
-rw-r--r-- | sys/net/route.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 397478c94c2..dae732130f8 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.351 2017/02/15 18:53:29 bluhm Exp $ */ +/* $OpenBSD: route.c,v 1.352 2017/02/28 10:16:38 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1084,7 +1084,8 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, error = rtable_insert(tableid, ndst, info->rti_info[RTAX_NETMASK], info->rti_info[RTAX_GATEWAY], rt->rt_priority, rt); - if (error != 0 && (crt = rtalloc(ndst, 0, tableid)) != NULL) { + if (error != 0 && + (crt = rtable_match(tableid, ndst, NULL)) != NULL) { /* overwrite cloned route */ if (ISSET(crt->rt_flags, RTF_CLONED)) { struct ifnet *cifp; |