diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-03-02 14:39:25 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-03-02 14:39:25 +0000 |
commit | 44b45959b1b77c9051f78ff86e9a76438156aaaf (patch) | |
tree | 4f08badc1a8e523c6d2623c23560df4fdb623956 /sys | |
parent | 2b2bb8aed353f7593d0bf5944501f22173c45b35 (diff) |
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@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/radix_mpath.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |