Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f79b064c authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

vxlan: Checksum fixes



Call skb_pop_rcv_encapsulation and postpull_rcsum for the Ethernet
header to work properly with checksum complete.

Signed-off-by: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e5eb4e30
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -1156,15 +1156,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
	if (!vs)
	if (!vs)
		goto drop;
		goto drop;


	/* If the NIC driver gave us an encapsulated packet
	skb_pop_rcv_encapsulation(skb);
	 * 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);
	vs->rcv(vs, skb, vxh->vx_vni);
	return 0;
	return 0;
@@ -1201,6 +1193,7 @@ static void vxlan_rcv(struct vxlan_sock *vs,
	skb_reset_mac_header(skb);
	skb_reset_mac_header(skb);
	skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev)));
	skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev)));
	skb->protocol = eth_type_trans(skb, 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) */
	/* Ignore packet loops (and multicast echo) */
	if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
	if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))