summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-01-06 20:31:33 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-01-06 20:31:33 +0300
commite6c7f245411e9ddd8781315b4e2359f418e4339d (patch)
treedab168d130c60da47d43fcce27c8e7f410151afe
parent16e4de5b5e7fbbddd3f94a2cfcbdc079a1f00ce9 (diff)
downloadaccel-ppp-e6c7f245411e9ddd8781315b4e2359f418e4339d.tar.gz
accel-ppp-e6c7f245411e9ddd8781315b4e2359f418e4339d.zip
ipoe_mod: use least byte of hwaddr as hash key
-rw-r--r--drivers/ipoe/ipoe.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 71ae1e41..90b04cad 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -709,7 +709,7 @@ static struct ipoe_session *ipoe_lookup_hwaddr(__u8 *hwaddr)
u.hwaddr_u = 0;
memcpy(u.hwaddr, hwaddr, ETH_ALEN);
- head = &ipoe_list3[u.hwaddr_u & IPOE_HASH_BITS];
+ head = &ipoe_list3[hwaddr[ETH_ALEN - 1]];
rcu_read_lock();
@@ -1069,7 +1069,7 @@ static void ipoe_netdev_setup(struct net_device *dev)
#endif
dev->addr_len = ETH_ALEN;
dev->features |= NETIF_F_NETNS_LOCAL;
- dev->features &= ~NETIF_F_HW_VLAN_FILTER;
+ dev->features &= ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
dev->header_ops = &ipoe_hard_header_ops;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
}
@@ -1126,7 +1126,7 @@ static int ipoe_create(__be32 peer_addr, __be32 addr, __be32 gw, int ifindex, co
}
if (link_dev) {
- dev->features = link_dev->features & ~NETIF_F_HW_VLAN_FILTER;
+ dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
@@ -1162,7 +1162,7 @@ static int ipoe_create(__be32 peer_addr, __be32 addr, __be32 gw, int ifindex, co
list_add_tail_rcu(&ses->entry, &ipoe_list[h]);
list_add_tail(&ses->entry2, &ipoe_list2);
if (link_dev)
- list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr_u & IPOE_HASH_BITS]);
+ list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr[ETH_ALEN - 1]]);
r = dev->ifindex;
up(&ipoe_wlock);
@@ -1418,7 +1418,7 @@ static int ipoe_nl_cmd_modify(struct sk_buff *skb, struct genl_info *info)
}
if (link_dev) {
- ses->dev->features = link_dev->features & ~NETIF_F_HW_VLAN_FILTER;
+ ses->dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
@@ -1446,7 +1446,7 @@ static int ipoe_nl_cmd_modify(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[IPOE_ATTR_HWADDR]) {
nla_memcpy(ses->u.hwaddr, info->attrs[IPOE_ATTR_HWADDR], ETH_ALEN);
if (ses->link_dev)
- list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr_u & IPOE_HASH_BITS]);
+ list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr[ETH_ALEN - 1]]);
}
//pr_info("ipoe: modify %08x %08x\n", ses->peer_addr, ses->addr);