tmp_suning_uos_patched/net/openvswitch
Cong Wang 7b024082b2 openvswitch: fix the calculation of checksum for vlan header
In vlan_insert_tag(), we insert a 4-byte VLAN header _after_
mac header:

        memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
        ...
        veth->h_vlan_proto = htons(ETH_P_8021Q);
        ...
        veth->h_vlan_TCI = htons(vlan_tci);

so after it, we should recompute the checksum to include these 4 bytes.
skb->data still points to the mac header, therefore VLAN header is at
(2 * ETH_ALEN = 12) bytes after it, not (ETH_HLEN = 14) bytes.

This can also be observed via tcpdump:

         0x0000:  ffff ffff ffff 5254 005d 6f6e 8100 000a
         0x0010:  0806 0001 0800 0604 0001 5254 005d 6f6e
         0x0020:  c0a8 026e 0000 0000 0000 c0a8 0282

Similar for __pop_vlan_tci(), the vlan header we remove is the one
overwritten in:

	memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);

Therefore the VLAN_HLEN = 4 bytes after 2 * ETH_ALEN is the part
we want to sub from checksum.

Cc: David S. Miller <davem@davemloft.net>
Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2013-02-22 17:02:38 -08:00
..
actions.c openvswitch: fix the calculation of checksum for vlan header 2013-02-22 17:02:38 -08:00
datapath.c openvswitch: Call genlmsg_end in queue_userspace_packet 2013-02-22 17:02:11 -08:00
datapath.h netlink: Rename pid to portid to avoid confusion 2012-09-10 15:30:41 -04:00
dp_notify.c openvswitch: Add support for network namespaces. 2012-08-22 14:48:55 -07:00
flow.c openvswitch: Fix parsing invalid LLC/SNAP ethertypes 2013-02-22 17:02:28 -08:00
flow.h openvswitch: add skb mark matching and set action 2012-11-26 11:33:18 -08:00
Kconfig net: Add Open vSwitch kernel components. 2011-12-03 09:35:17 -08:00
Makefile net: Add Open vSwitch kernel components. 2011-12-03 09:35:17 -08:00
vport-internal_dev.c openvswitch: Add support for network namespaces. 2012-08-22 14:48:55 -07:00
vport-internal_dev.h openvswitch: Replace Nicira Networks. 2012-05-03 18:55:23 -07:00
vport-netdev.c openvswitch: Move LRO check from transmit to receive. 2013-01-21 23:57:26 -08:00
vport-netdev.h openvswitch: Use RCU callback when detaching netdevices. 2012-11-28 14:04:34 -08:00
vport.c net: openvswitch: use this_cpu_ptr per-cpu helper 2012-11-16 13:26:20 -08:00
vport.h netlink: Rename pid to portid to avoid confusion 2012-09-10 15:30:41 -04:00