Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Don't rt_setkey twice
details: https://anonhg.NetBSD.org/src/rev/81f686becb5d
branches: trunk
changeset: 344869:81f686becb5d
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon Apr 25 14:30:42 2016 +0000
description:
Don't rt_setkey twice
diffstat:
sys/net/route.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (49 lines):
diff -r 41f8f8203d43 -r 81f686becb5d sys/net/route.c
--- a/sys/net/route.c Mon Apr 25 13:20:42 2016 +0000
+++ b/sys/net/route.c Mon Apr 25 14:30:42 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: route.c,v 1.162 2016/04/13 00:47:01 ozaki-r Exp $ */
+/* $NetBSD: route.c,v 1.163 2016/04/25 14:30:42 ozaki-r Exp $ */
/*-
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.162 2016/04/13 00:47:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.163 2016/04/25 14:30:42 ozaki-r Exp $");
#include <sys/param.h>
#ifdef RTFLUSH_DEBUG
@@ -808,22 +808,22 @@
memset(rt, 0, sizeof(*rt));
rt->rt_flags = RTF_UP | flags;
LIST_INIT(&rt->rt_timer);
- RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
- if (rt_setkey(rt, dst, M_NOWAIT) == NULL ||
- rt_setgate(rt, gateway) != 0) {
- pool_put(&rtentry_pool, rt);
- senderr(ENOBUFS);
- }
+
RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
if (netmask) {
rt_maskedcopy(dst, (struct sockaddr *)&maskeddst,
netmask);
rt_setkey(rt, (struct sockaddr *)&maskeddst, M_NOWAIT);
- RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
} else {
rt_setkey(rt, dst, M_NOWAIT);
- RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
}
+ RT_DPRINTF("rt->_rt_key = %p\n", (void *)rt->_rt_key);
+ if (rt_getkey(rt) == NULL ||
+ rt_setgate(rt, gateway) != 0) {
+ pool_put(&rtentry_pool, rt);
+ senderr(ENOBUFS);
+ }
+
rt_set_ifa(rt, ifa);
if (info->rti_info[RTAX_TAG] != NULL)
rt_settag(rt, info->rti_info[RTAX_TAG]);
Home |
Main Index |
Thread Index |
Old Index