diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-09 04:40:57 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:52 -0400 |
commit | 3b04ddde02cf1b6f14f2697da5c20eca5715017f (patch) | |
tree | 9da1341a5a399a507b5ea6bf5a3047506b8d8f8f /net/ipv4/arp.c | |
parent | b95cce3576813ac3f86bafa6b5daaaaf7574b0fe (diff) |
[NET]: Move hardware header operations out of netdevice.
Since hardware header operations are part of the protocol class
not the device instance, make them into a separate object and
save memory.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 5b24c65b13c6..d8248198bcd7 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -253,7 +253,7 @@ static int arp_constructor(struct neighbour *neigh) | |||
253 | neigh->parms = neigh_parms_clone(parms); | 253 | neigh->parms = neigh_parms_clone(parms); |
254 | rcu_read_unlock(); | 254 | rcu_read_unlock(); |
255 | 255 | ||
256 | if (dev->hard_header == NULL) { | 256 | if (!dev->header_ops) { |
257 | neigh->nud_state = NUD_NOARP; | 257 | neigh->nud_state = NUD_NOARP; |
258 | neigh->ops = &arp_direct_ops; | 258 | neigh->ops = &arp_direct_ops; |
259 | neigh->output = neigh->ops->queue_xmit; | 259 | neigh->output = neigh->ops->queue_xmit; |
@@ -310,10 +310,12 @@ static int arp_constructor(struct neighbour *neigh) | |||
310 | neigh->nud_state = NUD_NOARP; | 310 | neigh->nud_state = NUD_NOARP; |
311 | memcpy(neigh->ha, dev->broadcast, dev->addr_len); | 311 | memcpy(neigh->ha, dev->broadcast, dev->addr_len); |
312 | } | 312 | } |
313 | if (dev->hard_header_cache) | 313 | |
314 | if (dev->header_ops->cache) | ||
314 | neigh->ops = &arp_hh_ops; | 315 | neigh->ops = &arp_hh_ops; |
315 | else | 316 | else |
316 | neigh->ops = &arp_generic_ops; | 317 | neigh->ops = &arp_generic_ops; |
318 | |||
317 | if (neigh->nud_state&NUD_VALID) | 319 | if (neigh->nud_state&NUD_VALID) |
318 | neigh->output = neigh->ops->connected_output; | 320 | neigh->output = neigh->ops->connected_output; |
319 | else | 321 | else |