]> Pileus Git - ~andy/linux/blobdiff - drivers/net/vxlan.c
net/vxlan: Share RX skb de-marking and checksum checks with ovs
[~andy/linux] / drivers / net / vxlan.c
index e1bc9252e3f43aced911a487f46846863965465e..026a313c2d2da4c3eb57d0c5f6a051bbbdc852b2 100644 (file)
@@ -1159,6 +1159,16 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
        if (!vs)
                goto drop;
 
+       /* If the NIC driver gave us an encapsulated packet
+        * with the encapsulation mark, the device checksummed it
+        * for us. Otherwise force the upper layers to verify it.
+        */
+       if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
+           !skb->encapsulation)
+               skb->ip_summed = CHECKSUM_NONE;
+
+       skb->encapsulation = 0;
+
        vs->rcv(vs, skb, vxh->vx_vni);
        return 0;
 
@@ -1217,17 +1227,6 @@ static void vxlan_rcv(struct vxlan_sock *vs,
 
        skb_reset_network_header(skb);
 
-       /* If the NIC driver gave us an encapsulated packet with
-        * CHECKSUM_UNNECESSARY and Rx checksum feature is enabled,
-        * leave the CHECKSUM_UNNECESSARY, the device checksummed it
-        * for us. Otherwise force the upper layers to verify it.
-        */
-       if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
-           !skb->encapsulation || !(vxlan->dev->features & NETIF_F_RXCSUM))
-               skb->ip_summed = CHECKSUM_NONE;
-
-       skb->encapsulation = 0;
-
        if (oip6)
                err = IP6_ECN_decapsulate(oip6, skb);
        if (oip)