From: Al Viro Date: Wed, 27 Sep 2006 05:26:21 +0000 (-0700) Subject: [IPV4] bug: broken open-coded inet_make_mask() (multipath_wrandom) X-Git-Tag: v2.6.19-rc1~858^2~120 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8192f367cb3dcbefaa4109d26f3b1645b0c6b56;p=linux-2.6 [IPV4] bug: broken open-coded inet_make_mask() (multipath_wrandom) multipath_wrandom.c::__multipath_lookup_weight() contains open-coded attempt at inet_make_mask(); broken on big-endian. Signed-off-by: Al Viro Signed-off-by: David S. Miller --- diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c index 32dbd6906a..92b04823e0 100644 --- a/net/ipv4/multipath_wrandom.c +++ b/net/ipv4/multipath_wrandom.c @@ -128,8 +128,8 @@ static unsigned char __multipath_lookup_weight(const struct flowi *fl, /* find state entry for destination */ list_for_each_entry_rcu(d, &target_route->dests, list) { - __u32 targetnetwork = fl->fl4_dst & - (0xFFFFFFFF >> (32 - d->prefixlen)); + __be32 targetnetwork = fl->fl4_dst & + inet_make_mask(d->prefixlen); if ((targetnetwork & d->netmask) == d->network) { weight = d->nh_info->nh_weight;