Skip to content

Commit

Permalink
ipv4: Fix __ip_dev_find() to use ifa_local instead of ifa_address.
Browse files Browse the repository at this point in the history
Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 3, 2011
1 parent d276055 commit e066008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static inline unsigned int inet_addr_hash(struct net *net, __be32 addr)

static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
{
unsigned int hash = inet_addr_hash(net, ifa->ifa_address);
unsigned int hash = inet_addr_hash(net, ifa->ifa_local);

spin_lock(&inet_addr_hash_lock);
hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
Expand Down Expand Up @@ -146,7 +146,7 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)

if (!net_eq(dev_net(dev), net))
continue;
if (ifa->ifa_address == addr) {
if (ifa->ifa_local == addr) {
result = dev;
break;
}
Expand Down

0 comments on commit e066008

Please sign in to comment.