From fb0cdfeed631b7577e1cbef3b1c3b3ff032c5a88 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 19 Jun 2006 08:14:07 +0000 Subject: 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@ --- sys/net/route.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') 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 -- cgit v1.2.3