vxlan: set mac_header correctly in GPE mode
authorJiri Benc <jbenc@redhat.com>
Fri, 13 May 2016 08:48:42 +0000 (10:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2016 17:37:10 +0000 (13:37 -0400)
For VXLAN-GPE, the interface is ARPHRD_NONE, thus we need to reset
mac_header after pulling the outer header.

v2: Put the code to the existing conditional block as suggested by
    Shmulik Ladkani.

Fixes: e1e5314de08b ("vxlan: implement GPE")
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index 2f29d20..25ab6bf 100644 (file)
@@ -1381,6 +1381,7 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
                if (!vxlan_set_mac(vxlan, vs, skb))
                        goto drop;
        } else {
+               skb_reset_mac_header(skb);
                skb->dev = vxlan->dev;
                skb->pkt_type = PACKET_HOST;
        }