diff options
author | Tom Herbert <therbert@google.com> | 2014-06-15 02:24:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-15 04:00:50 -0400 |
commit | f79b064c15068176e3f6f67715aafd7fe183120c (patch) | |
tree | e1b1b85a1b30f00acf147818537b7e7bd7b3b86c | |
parent | e5eb4e30a51236079fb22bb9f75fcd31915b03c6 (diff) |
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 <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/vxlan.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index e0995ffd046d..ade33ef82823 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1156,15 +1156,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) | |||
1156 | if (!vs) | 1156 | if (!vs) |
1157 | goto drop; | 1157 | goto drop; |
1158 | 1158 | ||
1159 | /* If the NIC driver gave us an encapsulated packet | 1159 | skb_pop_rcv_encapsulation(skb); |
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; | ||
1168 | 1160 | ||
1169 | vs->rcv(vs, skb, vxh->vx_vni); | 1161 | vs->rcv(vs, skb, vxh->vx_vni); |
1170 | return 0; | 1162 | return 0; |
@@ -1201,6 +1193,7 @@ static void vxlan_rcv(struct vxlan_sock *vs, | |||
1201 | skb_reset_mac_header(skb); | 1193 | skb_reset_mac_header(skb); |
1202 | skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev))); | 1194 | skb_scrub_packet(skb, !net_eq(vxlan->net, dev_net(vxlan->dev))); |
1203 | skb->protocol = eth_type_trans(skb, vxlan->dev); | 1195 | skb->protocol = eth_type_trans(skb, vxlan->dev); |
1196 | skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); | ||
1204 | 1197 | ||
1205 | /* Ignore packet loops (and multicast echo) */ | 1198 | /* Ignore packet loops (and multicast echo) */ |
1206 | if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr)) | 1199 | if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr)) |