mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +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
|
@ -354,7 +354,7 @@ static int ndisc_constructor(struct neighbour *neigh)
|
|||
rcu_read_unlock();
|
||||
|
||||
neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST;
|
||||
if (dev->hard_header == NULL) {
|
||||
if (!dev->header_ops) {
|
||||
neigh->nud_state = NUD_NOARP;
|
||||
neigh->ops = &ndisc_direct_ops;
|
||||
neigh->output = neigh->ops->queue_xmit;
|
||||
|
@ -371,7 +371,7 @@ static int ndisc_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 = &ndisc_hh_ops;
|
||||
else
|
||||
neigh->ops = &ndisc_generic_ops;
|
||||
|
@ -807,7 +807,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
|
|||
neigh_update(neigh, lladdr, NUD_STALE,
|
||||
NEIGH_UPDATE_F_WEAK_OVERRIDE|
|
||||
NEIGH_UPDATE_F_OVERRIDE);
|
||||
if (neigh || !dev->hard_header) {
|
||||
if (neigh || !dev->header_ops) {
|
||||
ndisc_send_na(dev, neigh, saddr, &msg->target,
|
||||
is_router,
|
||||
1, (ifp != NULL && inc), inc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue