svn commit: r184776 - user/kmacy/HEAD_fast_multi_xmit/sys/net
Kip Macy
kmacy at FreeBSD.org
Sat Nov 8 16:49:36 PST 2008
Author: kmacy
Date: Sun Nov 9 00:49:36 2008
New Revision: 184776
URL: http://svn.freebsd.org/changeset/base/184776
Log:
validate rtentry before doing any other checks
Modified:
user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c
Modified: user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c
==============================================================================
--- user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c Sun Nov 9 00:38:11 2008 (r184775)
+++ user/kmacy/HEAD_fast_multi_xmit/sys/net/flowtable.c Sun Nov 9 00:49:36 2008 (r184776)
@@ -599,8 +599,9 @@ static __inline int
gw_valid(struct rtentry *rt)
{
return ((rt->rt_flags & RTF_GATEWAY) == 0 ||
- ((rt->rt_flags & RTF_GATEWAY) &&
- (rt->rt_gwroute->rt_flags & RTF_UP)));
+ ((rt->rt_flags & RTF_GATEWAY)
+ && (rt->rt_gwroute != NULL)
+ && (rt->rt_gwroute->rt_flags & RTF_UP)));
}
@@ -642,7 +643,8 @@ flowtable_lookup(struct flowtable *ft, s
FL_ENTRY_LOCK(ft, hash);
fle = FL_ENTRY(ft, hash);
rt = __DEVOLATILE(struct rtentry *, fle->f_rt);
- if (fle->f_fhash == hash
+ if ((rt != NULL)
+ && fle->f_fhash == hash
&& flowtable_key_equal(fle, key, flags)
&& (proto == fle->f_proto)
&& (rt->rt_flags & RTF_UP)
More information about the svn-src-user
mailing list