After inserting the VLAN tag with __vlan_put_tag(), we should
re-calculate the skb checksum if it is done.

Cc: Jesse Gross <je...@nicira.com>
Signed-off-by: Cong Wang <amw...@redhat.com>

---
diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
index 727194e..99a6eca 100644
--- a/datapath/vport-netdev.c
+++ b/datapath/vport-netdev.c
@@ -313,6 +313,10 @@ static int netdev_send(struct vport *vport, struct sk_buff 
*skb)
 
                                skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb));
                                if (likely(skb)) {
+                                       if (skb->ip_summed == CHECKSUM_COMPLETE)
+                                               skb->csum = csum_add(skb->csum, 
csum_partial(skb->data
+                                                                    + (2 * 
ETH_ALEN), VLAN_HLEN, 0));
+
                                        len += skb->len;
                                        vlan_set_tci(skb, 0);
                                        dev_queue_xmit(skb);
@@ -328,6 +332,9 @@ tag:
                skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb));
                if (unlikely(!skb))
                        return 0;
+               if (skb->ip_summed == CHECKSUM_COMPLETE)
+                       skb->csum = csum_add(skb->csum, csum_partial(skb->data
+                                            + (2 * ETH_ALEN), VLAN_HLEN, 0));
                vlan_set_tci(skb, 0);
        }
 
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to