]> git.baikalelectronics.ru Git - kernel.git/commitdiff
openvswitch: allow L3 netdev ports
authorJiri Benc <jbenc@redhat.com>
Thu, 10 Nov 2016 15:28:24 +0000 (16:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 13 Nov 2016 05:51:02 +0000 (00:51 -0500)
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>
net/openvswitch/vport-netdev.c

index e825753de1e0065944a1e555872efe2198e4f3b0..0389398fa4ab81a57a4b27f47ffc879f8904f446 100644 (file)
@@ -57,8 +57,10 @@ static void netdev_port_receive(struct sk_buff *skb)
        if (unlikely(!skb))
                return;
 
-       skb_push(skb, ETH_HLEN);
-       skb_postpush_rcsum(skb, skb->data, ETH_HLEN);
+       if (skb->dev->type == ARPHRD_ETHER) {
+               skb_push(skb, ETH_HLEN);
+               skb_postpush_rcsum(skb, skb->data, ETH_HLEN);
+       }
        ovs_vport_receive(vport, skb, skb_tunnel_info(skb));
        return;
 error:
@@ -97,7 +99,8 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name)
        }
 
        if (vport->dev->flags & IFF_LOOPBACK ||
-           vport->dev->type != ARPHRD_ETHER ||
+           (vport->dev->type != ARPHRD_ETHER &&
+            vport->dev->type != ARPHRD_NONE) ||
            ovs_is_internal_dev(vport->dev)) {
                err = -EINVAL;
                goto error_put;