From 44b45959b1b77c9051f78ff86e9a76438156aaaf Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 2 Mar 2009 14:39:25 +0000 Subject: Make sure rt_gateway is not NULL in rt_mpath_matchgate(). It is possible to hit this case with a root node that comes with no real rtentry attached to it. Problem found by Mischa Diehm, OK henning@ --- sys/net/radix_mpath.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/net') diff --git a/sys/net/radix_mpath.c b/sys/net/radix_mpath.c index 3856192e2a6..23eec409a64 100644 --- a/sys/net/radix_mpath.c +++ b/sys/net/radix_mpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radix_mpath.c,v 1.16 2009/01/29 13:14:08 claudio Exp $ */ +/* $OpenBSD: radix_mpath.c,v 1.17 2009/03/02 14:39:24 claudio Exp $ */ /* $KAME: radix_mpath.c,v 1.13 2002/10/28 21:05:59 itojun Exp $ */ /* @@ -261,7 +261,8 @@ rt_mpath_matchgate(struct rtentry *rt, struct sockaddr *gate, u_int8_t prio) return rt; if (!gate) return NULL; - + if (!rt->rt_gateway) + continue; if (rt->rt_gateway->sa_len == gate->sa_len && !memcmp(rt->rt_gateway, gate, gate->sa_len)) break; -- cgit v1.2.3