Skip to content

Commit

Permalink
vxlan: Checksum fixes
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tom Herbert authored and davem330 committed Jun 15, 2014
1 parent e5eb4e3 commit f79b064
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1156,15 +1156,7 @@ 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;
skb_pop_rcv_encapsulation(skb);

vs->rcv(vs, skb, vxh->vx_vni);
return 0;
Expand Down Expand Up @@ -1201,6 +1193,7 @@ static void vxlan_rcv(struct vxlan_sock *vs,
skb_reset_mac_header(skb);
skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev)));
skb->protocol = eth_type_trans(skb, vxlan->dev);
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);

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

0 comments on commit f79b064

Please sign in to comment.