diff options
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1b74d3b6437..96a164aa136 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -97,7 +97,6 @@ | |||
97 | #include <linux/init.h> | 97 | #include <linux/init.h> |
98 | #include <linux/net.h> | 98 | #include <linux/net.h> |
99 | #include <linux/rcupdate.h> | 99 | #include <linux/rcupdate.h> |
100 | #include <linux/jhash.h> | ||
101 | #include <linux/slab.h> | 100 | #include <linux/slab.h> |
102 | #ifdef CONFIG_SYSCTL | 101 | #ifdef CONFIG_SYSCTL |
103 | #include <linux/sysctl.h> | 102 | #include <linux/sysctl.h> |
@@ -139,8 +138,6 @@ static const struct neigh_ops arp_generic_ops = { | |||
139 | .error_report = arp_error_report, | 138 | .error_report = arp_error_report, |
140 | .output = neigh_resolve_output, | 139 | .output = neigh_resolve_output, |
141 | .connected_output = neigh_connected_output, | 140 | .connected_output = neigh_connected_output, |
142 | .hh_output = dev_queue_xmit, | ||
143 | .queue_xmit = dev_queue_xmit, | ||
144 | }; | 141 | }; |
145 | 142 | ||
146 | static const struct neigh_ops arp_hh_ops = { | 143 | static const struct neigh_ops arp_hh_ops = { |
@@ -149,16 +146,12 @@ static const struct neigh_ops arp_hh_ops = { | |||
149 | .error_report = arp_error_report, | 146 | .error_report = arp_error_report, |
150 | .output = neigh_resolve_output, | 147 | .output = neigh_resolve_output, |
151 | .connected_output = neigh_resolve_output, | 148 | .connected_output = neigh_resolve_output, |
152 | .hh_output = dev_queue_xmit, | ||
153 | .queue_xmit = dev_queue_xmit, | ||
154 | }; | 149 | }; |
155 | 150 | ||
156 | static const struct neigh_ops arp_direct_ops = { | 151 | static const struct neigh_ops arp_direct_ops = { |
157 | .family = AF_INET, | 152 | .family = AF_INET, |
158 | .output = dev_queue_xmit, | 153 | .output = neigh_direct_output, |
159 | .connected_output = dev_queue_xmit, | 154 | .connected_output = neigh_direct_output, |
160 | .hh_output = dev_queue_xmit, | ||
161 | .queue_xmit = dev_queue_xmit, | ||
162 | }; | 155 | }; |
163 | 156 | ||
164 | static const struct neigh_ops arp_broken_ops = { | 157 | static const struct neigh_ops arp_broken_ops = { |
@@ -167,8 +160,6 @@ static const struct neigh_ops arp_broken_ops = { | |||
167 | .error_report = arp_error_report, | 160 | .error_report = arp_error_report, |
168 | .output = neigh_compat_output, | 161 | .output = neigh_compat_output, |
169 | .connected_output = neigh_compat_output, | 162 | .connected_output = neigh_compat_output, |
170 | .hh_output = dev_queue_xmit, | ||
171 | .queue_xmit = dev_queue_xmit, | ||
172 | }; | 163 | }; |
173 | 164 | ||
174 | struct neigh_table arp_tbl = { | 165 | struct neigh_table arp_tbl = { |
@@ -232,7 +223,7 @@ static u32 arp_hash(const void *pkey, | |||
232 | const struct net_device *dev, | 223 | const struct net_device *dev, |
233 | __u32 hash_rnd) | 224 | __u32 hash_rnd) |
234 | { | 225 | { |
235 | return jhash_2words(*(u32 *)pkey, dev->ifindex, hash_rnd); | 226 | return arp_hashfn(*(u32 *)pkey, dev, hash_rnd); |
236 | } | 227 | } |
237 | 228 | ||
238 | static int arp_constructor(struct neighbour *neigh) | 229 | static int arp_constructor(struct neighbour *neigh) |
@@ -259,7 +250,7 @@ static int arp_constructor(struct neighbour *neigh) | |||
259 | if (!dev->header_ops) { | 250 | if (!dev->header_ops) { |
260 | neigh->nud_state = NUD_NOARP; | 251 | neigh->nud_state = NUD_NOARP; |
261 | neigh->ops = &arp_direct_ops; | 252 | neigh->ops = &arp_direct_ops; |
262 | neigh->output = neigh->ops->queue_xmit; | 253 | neigh->output = neigh_direct_output; |
263 | } else { | 254 | } else { |
264 | /* Good devices (checked by reading texts, but only Ethernet is | 255 | /* Good devices (checked by reading texts, but only Ethernet is |
265 | tested) | 256 | tested) |
@@ -518,30 +509,6 @@ EXPORT_SYMBOL(arp_find); | |||
518 | 509 | ||
519 | /* END OF OBSOLETE FUNCTIONS */ | 510 | /* END OF OBSOLETE FUNCTIONS */ |
520 | 511 | ||
521 | int arp_bind_neighbour(struct dst_entry *dst) | ||
522 | { | ||
523 | struct net_device *dev = dst->dev; | ||
524 | struct neighbour *n = dst->neighbour; | ||
525 | |||
526 | if (dev == NULL) | ||
527 | return -EINVAL; | ||
528 | if (n == NULL) { | ||
529 | __be32 nexthop = ((struct rtable *)dst)->rt_gateway; | ||
530 | if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) | ||
531 | nexthop = 0; | ||
532 | n = __neigh_lookup_errno( | ||
533 | #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) | ||
534 | dev->type == ARPHRD_ATM ? | ||
535 | clip_tbl_hook : | ||
536 | #endif | ||
537 | &arp_tbl, &nexthop, dev); | ||
538 | if (IS_ERR(n)) | ||
539 | return PTR_ERR(n); | ||
540 | dst->neighbour = n; | ||
541 | } | ||
542 | return 0; | ||
543 | } | ||
544 | |||
545 | /* | 512 | /* |
546 | * Check if we can use proxy ARP for this path | 513 | * Check if we can use proxy ARP for this path |
547 | */ | 514 | */ |