diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-03-07 16:25:56 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-08 19:30:06 -0400 |
commit | b79bda3d38ae67940f1740f7e015f284eb551680 (patch) | |
tree | fb927e9867e7a013c4ce142a993458d15ee20cef /net/core | |
parent | 7d5f41f276b376d567e919530f8b5fd70be25426 (diff) | |
download | op-kernel-dev-b79bda3d38ae67940f1740f7e015f284eb551680.zip op-kernel-dev-b79bda3d38ae67940f1740f7e015f284eb551680.tar.gz |
neigh: Use neigh table index for neigh_packet_xmit
Remove a little bit of unnecessary work when transmitting a packet with
neigh_packet_xmit. Use the neighbour table index not the address family
as a parameter.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/neighbour.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index cffaf00..ad07990 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -2391,22 +2391,15 @@ void __neigh_for_each_release(struct neigh_table *tbl, } EXPORT_SYMBOL(__neigh_for_each_release); -int neigh_xmit(int family, struct net_device *dev, +int neigh_xmit(int index, struct net_device *dev, const void *addr, struct sk_buff *skb) { - int err; - if (family == AF_PACKET) { - err = dev_hard_header(skb, dev, ntohs(skb->protocol), - addr, NULL, skb->len); - if (err < 0) - goto out_kfree_skb; - err = dev_queue_xmit(skb); - } else { + int err = -EAFNOSUPPORT; + if (likely(index < NEIGH_NR_TABLES)) { struct neigh_table *tbl; struct neighbour *neigh; - err = -ENETDOWN; - tbl = neigh_find_table(family); + tbl = neigh_tables[index]; if (!tbl) goto out; neigh = __neigh_lookup_noref(tbl, addr, dev); @@ -2417,6 +2410,13 @@ int neigh_xmit(int family, struct net_device *dev, goto out_kfree_skb; err = neigh->output(neigh, skb); } + else if (index == NEIGH_LINK_TABLE) { + err = dev_hard_header(skb, dev, ntohs(skb->protocol), + addr, NULL, skb->len); + if (err < 0) + goto out_kfree_skb; + err = dev_queue_xmit(skb); + } out: return err; out_kfree_skb: |