summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-06-19 08:14:07 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-06-19 08:14:07 +0000
commitfb0cdfeed631b7577e1cbef3b1c3b3ff032c5a88 (patch)
tree496e23dec3768eaacdd36cb65962d6f7b4ab7f2d /sys/net
parentc752076198aa7348d06ad867cc37c9e270e6e404 (diff)
Unbreak the tree. The code to set and unset the RTF_MPATH bit on all multipath
routes did not carefully check if the route lookup succeded or not and so rn_mpath_next(rn) blowed up because rn was NULL. Check if rnh_lookup succeded before touching rn in anyway. OK norby@ initial diff by hshoexer@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index d96c72f2617..a58a41afeeb 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.80 2006/06/17 17:20:00 pascoe Exp $ */
+/* $OpenBSD: route.c,v 1.81 2006/06/19 08:14:06 claudio Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -891,9 +891,9 @@ makeroute:
}
#ifndef SMALL_KERNEL
- if (rn_mpath_capable(rnh)) {
- rn = rnh->rnh_lookup(info->rti_info[RTAX_DST],
- info->rti_info[RTAX_NETMASK], rnh);
+ if (rn_mpath_capable(rnh) &&
+ (rn = rnh->rnh_lookup(info->rti_info[RTAX_DST],
+ info->rti_info[RTAX_NETMASK], rnh)) != NULL) {
if (rn_mpath_next(rn) == NULL)
((struct rtentry *)rn)->rt_flags &= ~RTF_MPATH;
else