Skip to content

Commit

Permalink
[IPV4] bug: broken open-coded inet_make_mask() (multipath_wrandom)
Browse files Browse the repository at this point in the history
multipath_wrandom.c::__multipath_lookup_weight() contains open-coded
attempt at inet_make_mask(); broken on big-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Al Viro authored and David S. Miller committed Sep 29, 2006
1 parent f20f4a6 commit e8192f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/multipath_wrandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e8192f3

Please sign in to comment.