Commit 9b974499 authored by David S. Miller's avatar David S. Miller

Merge branch 'mpls-next'

Eric W. Biederman says:

====================
mpls: Minor fixes and cleanups

This is a bunch of small changes that have come out of the discussions
of the mpls code and the automated tests that people run against things.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 008a5b07 b79bda3d
...@@ -226,6 +226,7 @@ enum { ...@@ -226,6 +226,7 @@ enum {
NEIGH_ND_TABLE = 1, NEIGH_ND_TABLE = 1,
NEIGH_DN_TABLE = 2, NEIGH_DN_TABLE = 2,
NEIGH_NR_TABLES, NEIGH_NR_TABLES,
NEIGH_LINK_TABLE = NEIGH_NR_TABLES /* Pseudo table for neigh_xmit */
}; };
static inline int neigh_parms_family(struct neigh_parms *p) static inline int neigh_parms_family(struct neigh_parms *p)
......
...@@ -2391,22 +2391,15 @@ void __neigh_for_each_release(struct neigh_table *tbl, ...@@ -2391,22 +2391,15 @@ void __neigh_for_each_release(struct neigh_table *tbl,
} }
EXPORT_SYMBOL(__neigh_for_each_release); 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) const void *addr, struct sk_buff *skb)
{ {
int err; int err = -EAFNOSUPPORT;
if (family == AF_PACKET) { if (likely(index < NEIGH_NR_TABLES)) {
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 {
struct neigh_table *tbl; struct neigh_table *tbl;
struct neighbour *neigh; struct neighbour *neigh;
err = -ENETDOWN; tbl = neigh_tables[index];
tbl = neigh_find_table(family);
if (!tbl) if (!tbl)
goto out; goto out;
neigh = __neigh_lookup_noref(tbl, addr, dev); neigh = __neigh_lookup_noref(tbl, addr, dev);
...@@ -2417,6 +2410,13 @@ int neigh_xmit(int family, struct net_device *dev, ...@@ -2417,6 +2410,13 @@ int neigh_xmit(int family, struct net_device *dev,
goto out_kfree_skb; goto out_kfree_skb;
err = neigh->output(neigh, 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: out:
return err; return err;
out_kfree_skb: out_kfree_skb:
......
This diff is collapsed.
...@@ -6,6 +6,7 @@ config OPENVSWITCH ...@@ -6,6 +6,7 @@ config OPENVSWITCH
tristate "Open vSwitch" tristate "Open vSwitch"
depends on INET depends on INET
select LIBCRC32C select LIBCRC32C
select MPLS
select NET_MPLS_GSO select NET_MPLS_GSO
---help--- ---help---
Open vSwitch is a multilayer Ethernet switch targeted at virtualized Open vSwitch is a multilayer Ethernet switch targeted at virtualized
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment