aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-03-02 01:13:22 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-02 16:43:41 -0500
commitbdf53c58490bb52e17636eca8ad18d2c38ec3cb8 (patch)
tree01c3bae0fbaca8d1ba308d527ac2b1900ffb3b13 /net
parent59b2af26b9f674749216fd3bfba19d842de3671c (diff)
neigh: Don't require dst in neigh_hh_init
- Add protocol to neigh_tbl so that dst->ops->protocol is not needed - Acquire the device from neigh->dev This results in a neigh_hh_init that will cache the samve values regardless of the packets flowing through it. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/neighbour.c8
-rw-r--r--net/decnet/dn_neigh.c1
-rw-r--r--net/ipv4/arp.c1
-rw-r--r--net/ipv6/ndisc.c1
4 files changed, 7 insertions, 4 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8a319ff3e8d1..af72b863e968 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1263,10 +1263,10 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl,
1263EXPORT_SYMBOL(neigh_event_ns); 1263EXPORT_SYMBOL(neigh_event_ns);
1264 1264
1265/* called with read_lock_bh(&n->lock); */ 1265/* called with read_lock_bh(&n->lock); */
1266static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst) 1266static void neigh_hh_init(struct neighbour *n)
1267{ 1267{
1268 struct net_device *dev = dst->dev; 1268 struct net_device *dev = n->dev;
1269 __be16 prot = dst->ops->protocol; 1269 __be16 prot = n->tbl->protocol;
1270 struct hh_cache *hh = &n->hh; 1270 struct hh_cache *hh = &n->hh;
1271 1271
1272 write_lock_bh(&n->lock); 1272 write_lock_bh(&n->lock);
@@ -1296,7 +1296,7 @@ int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb)
1296 unsigned int seq; 1296 unsigned int seq;
1297 1297
1298 if (dev->header_ops->cache && !neigh->hh.hh_len) 1298 if (dev->header_ops->cache && !neigh->hh.hh_len)
1299 neigh_hh_init(neigh, dst); 1299 neigh_hh_init(neigh);
1300 1300
1301 do { 1301 do {
1302 __skb_pull(skb, skb_network_offset(skb)); 1302 __skb_pull(skb, skb_network_offset(skb));
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 7ca7c3143da3..f123c6c6748c 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -97,6 +97,7 @@ struct neigh_table dn_neigh_table = {
97 .family = PF_DECnet, 97 .family = PF_DECnet,
98 .entry_size = NEIGH_ENTRY_SIZE(sizeof(struct dn_neigh)), 98 .entry_size = NEIGH_ENTRY_SIZE(sizeof(struct dn_neigh)),
99 .key_len = sizeof(__le16), 99 .key_len = sizeof(__le16),
100 .protocol = cpu_to_be16(ETH_P_DNA_RT),
100 .hash = dn_neigh_hash, 101 .hash = dn_neigh_hash,
101 .constructor = dn_neigh_construct, 102 .constructor = dn_neigh_construct,
102 .id = "dn_neigh_cache", 103 .id = "dn_neigh_cache",
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index bca5b9d9b442..6b8aad6a0d7d 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -152,6 +152,7 @@ static const struct neigh_ops arp_direct_ops = {
152struct neigh_table arp_tbl = { 152struct neigh_table arp_tbl = {
153 .family = AF_INET, 153 .family = AF_INET,
154 .key_len = 4, 154 .key_len = 4,
155 .protocol = cpu_to_be16(ETH_P_IP),
155 .hash = arp_hash, 156 .hash = arp_hash,
156 .constructor = arp_constructor, 157 .constructor = arp_constructor,
157 .proxy_redo = parp_redo, 158 .proxy_redo = parp_redo,
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 471ed24aabae..e363bbc2420d 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -117,6 +117,7 @@ static const struct neigh_ops ndisc_direct_ops = {
117struct neigh_table nd_tbl = { 117struct neigh_table nd_tbl = {
118 .family = AF_INET6, 118 .family = AF_INET6,
119 .key_len = sizeof(struct in6_addr), 119 .key_len = sizeof(struct in6_addr),
120 .protocol = cpu_to_be16(ETH_P_IPV6),
120 .hash = ndisc_hash, 121 .hash = ndisc_hash,
121 .constructor = ndisc_constructor, 122 .constructor = ndisc_constructor,
122 .pconstructor = pndisc_constructor, 123 .pconstructor = pndisc_constructor,