From: Al Viro Date: Wed, 27 Sep 2006 05:21:22 +0000 (-0700) Subject: [IPV4] bug: open-coded inet_make_mask() in fib_semantic_match() is broken X-Git-Tag: firefly_0821_release~33232^2~124 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1e8aa6f125d959d1a9f16a3f15e9ebbc6df63935;p=firefly-linux-kernel-4.4.55.git [IPV4] bug: open-coded inet_make_mask() in fib_semantic_match() is broken ... and works only on little-endian Signed-off-by: Al Viro Signed-off-by: David S. Miller --- diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 66b78df1c672..f7567e92cd9e 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -914,8 +914,7 @@ out_fill_res: res->fi = fa->fa_info; #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED res->netmask = mask; - res->network = zone & - (0xFFFFFFFF >> (32 - prefixlen)); + res->network = zone & inet_make_mask(prefixlen); #endif atomic_inc(&res->fi->fib_clntref); return 0;