From: Daniel Borkmann <dan...@iogearbox.net> Date: Fri, 1 Apr 2016 11:41:03 +0200
> Moreover, I noticed that when in the non-error path the __skb_pull() > is done and the original offset to mac header was non-zero, we fixup > from a wrong skb->data offset in the checksum complete processing. > > So the skb_postpush_rcsum() really needs to be done before __skb_pull() > where skb->data still points to the mac header start. Ugh, what a mess, are you sure any of this is right even after your change? What happens (outside of the csum part) is this: __skb_push(offset); __vlan_insert_tag(); { skb_push(VLAN_HLEN); ... memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); } __skb_pull(offset); If I understand this correctly, the last pull will therefore put skb->data pointing at vlan_ethhdr->h_vlan_TCI of the new VLAN header pushed by __vlan_insert_tag(). That is assuming skb->data began right after the original ethernet header. To me, that postpull csum currently is absolutely in the correct spot, because it's acting upon the pull done by __vlan_insert_tag(), not the one done here by skb_vlan_push(). Right? Can you tell me how you tested this? Just curious...