diff options
author | Jiri Benc <jbenc@redhat.com> | 2016-11-10 10:28:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-13 00:51:02 -0500 |
commit | 217ac77a3c2524d999730b2a80b61fcc2d0f734a (patch) | |
tree | 4223e36f63fb87bb4bdc5767dffef1fcbadcf34f | |
parent | 91820da6ae85904d95ed53bf3a83f9ec44a6b80a (diff) |
openvswitch: allow L3 netdev ports
Allow ARPHRD_NONE interfaces to be added to ovs bridge.
Based on previous versions by Lorand Jakab and Simon Horman.
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/openvswitch/vport-netdev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index e825753de1e0..0389398fa4ab 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c | |||
@@ -57,8 +57,10 @@ static void netdev_port_receive(struct sk_buff *skb) | |||
57 | if (unlikely(!skb)) | 57 | if (unlikely(!skb)) |
58 | return; | 58 | return; |
59 | 59 | ||
60 | skb_push(skb, ETH_HLEN); | 60 | if (skb->dev->type == ARPHRD_ETHER) { |
61 | skb_postpush_rcsum(skb, skb->data, ETH_HLEN); | 61 | skb_push(skb, ETH_HLEN); |
62 | skb_postpush_rcsum(skb, skb->data, ETH_HLEN); | ||
63 | } | ||
62 | ovs_vport_receive(vport, skb, skb_tunnel_info(skb)); | 64 | ovs_vport_receive(vport, skb, skb_tunnel_info(skb)); |
63 | return; | 65 | return; |
64 | error: | 66 | error: |
@@ -97,7 +99,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name) | |||
97 | } | 99 | } |
98 | 100 | ||
99 | if (vport->dev->flags & IFF_LOOPBACK || | 101 | if (vport->dev->flags & IFF_LOOPBACK || |
100 | vport->dev->type != ARPHRD_ETHER || | 102 | (vport->dev->type != ARPHRD_ETHER && |
103 | vport->dev->type != ARPHRD_NONE) || | ||
101 | ovs_is_internal_dev(vport->dev)) { | 104 | ovs_is_internal_dev(vport->dev)) { |
102 | err = -EINVAL; | 105 | err = -EINVAL; |
103 | goto error_put; | 106 | goto error_put; |