Skip to content

Commit f79b064

Browse files
Tom Herbertdavem330
authored andcommitted
vxlan: Checksum fixes
Call skb_pop_rcv_encapsulation and postpull_rcsum for the Ethernet header to work properly with checksum complete. Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e5eb4e3 commit f79b064

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/net/vxlan.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,15 +1156,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
11561156
if (!vs)
11571157
goto drop;
11581158

1159-
/* If the NIC driver gave us an encapsulated packet
1160-
* with the encapsulation mark, the device checksummed it
1161-
* for us. Otherwise force the upper layers to verify it.
1162-
*/
1163-
if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
1164-
!skb->encapsulation)
1165-
skb->ip_summed = CHECKSUM_NONE;
1166-
1167-
skb->encapsulation = 0;
1159+
skb_pop_rcv_encapsulation(skb);
11681160

11691161
vs->rcv(vs, skb, vxh->vx_vni);
11701162
return 0;
@@ -1201,6 +1193,7 @@ static void vxlan_rcv(struct vxlan_sock *vs,
12011193
skb_reset_mac_header(skb);
12021194
skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev)));
12031195
skb->protocol = eth_type_trans(skb, vxlan->dev);
1196+
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
12041197

12051198
/* Ignore packet loops (and multicast echo) */
12061199
if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))

0 commit comments

Comments
 (0)