mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
[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>
This commit is contained in:
parent
b95cce3576
commit
3b04ddde02
65 changed files with 479 additions and 473 deletions
|
@ -253,7 +253,7 @@ static int arp_constructor(struct neighbour *neigh)
|
|||
neigh->parms = neigh_parms_clone(parms);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (dev->hard_header == NULL) {
|
||||
if (!dev->header_ops) {
|
||||
neigh->nud_state = NUD_NOARP;
|
||||
neigh->ops = &arp_direct_ops;
|
||||
neigh->output = neigh->ops->queue_xmit;
|
||||
|
@ -310,10 +310,12 @@ static int arp_constructor(struct neighbour *neigh)
|
|||
neigh->nud_state = NUD_NOARP;
|
||||
memcpy(neigh->ha, dev->broadcast, dev->addr_len);
|
||||
}
|
||||
if (dev->hard_header_cache)
|
||||
|
||||
if (dev->header_ops->cache)
|
||||
neigh->ops = &arp_hh_ops;
|
||||
else
|
||||
neigh->ops = &arp_generic_ops;
|
||||
|
||||
if (neigh->nud_state&NUD_VALID)
|
||||
neigh->output = neigh->ops->connected_output;
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue