aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/vxlan.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index e1bc9252e3f4..026a313c2d2d 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1159,6 +1159,16 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
1159 if (!vs) 1159 if (!vs)
1160 goto drop; 1160 goto drop;
1161 1161
1162 /* If the NIC driver gave us an encapsulated packet
1163 * with the encapsulation mark, the device checksummed it
1164 * for us. Otherwise force the upper layers to verify it.
1165 */
1166 if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
1167 !skb->encapsulation)
1168 skb->ip_summed = CHECKSUM_NONE;
1169
1170 skb->encapsulation = 0;
1171
1162 vs->rcv(vs, skb, vxh->vx_vni); 1172 vs->rcv(vs, skb, vxh->vx_vni);
1163 return 0; 1173 return 0;
1164 1174
@@ -1217,17 +1227,6 @@ static void vxlan_rcv(struct vxlan_sock *vs,
1217 1227
1218 skb_reset_network_header(skb); 1228 skb_reset_network_header(skb);
1219 1229
1220 /* If the NIC driver gave us an encapsulated packet with
1221 * CHECKSUM_UNNECESSARY and Rx checksum feature is enabled,
1222 * leave the CHECKSUM_UNNECESSARY, the device checksummed it
1223 * for us. Otherwise force the upper layers to verify it.
1224 */
1225 if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
1226 !skb->encapsulation || !(vxlan->dev->features & NETIF_F_RXCSUM))
1227 skb->ip_summed = CHECKSUM_NONE;
1228
1229 skb->encapsulation = 0;
1230
1231 if (oip6) 1230 if (oip6)
1232 err = IP6_ECN_decapsulate(oip6, skb); 1231 err = IP6_ECN_decapsulate(oip6, skb);
1233 if (oip) 1232 if (oip)