WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] When we copy packet sin netback/netfront make sure the n

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] When we copy packet sin netback/netfront make sure the new skb has
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2006 09:38:15 +0000
Delivery-date: Thu, 11 May 2006 02:41:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 91c77df11b43894a2940b03029be46f6a1c85319
# Parent  36e0159c001b72969c5c9a9bf8bb48d8cfa932fa
When we copy packet sin netback/netfront make sure the new skb has
all the necessary fields initialised. In particular, before we were
not copying ip_summed and that screws up checksum offload.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netback/netback.c   |    3 ++-
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff -r 36e0159c001b -r 91c77df11b43 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Wed May 10 
16:52:55 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Wed May 10 
17:30:42 2006 +0100
@@ -170,9 +170,10 @@ int netif_be_start_xmit(struct sk_buff *
                ret = skb_copy_bits(skb, -hlen, nskb->data - hlen,
                                     skb->len + hlen);
                BUG_ON(ret);
+               /* Copy only the header fields we use in this driver. */
                nskb->dev = skb->dev;
+               nskb->ip_summed = skb->ip_summed;
                nskb->proto_data_valid = skb->proto_data_valid;
-               nskb->proto_csum_blank = skb->proto_csum_blank;
                dev_kfree_skb(skb);
                skb = nskb;
        }
diff -r 36e0159c001b -r 91c77df11b43 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed May 10 
16:52:55 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed May 10 
17:30:42 2006 +0100
@@ -665,7 +665,10 @@ static int network_start_xmit(struct sk_
                        goto drop;
                skb_put(nskb, skb->len);
                memcpy(nskb->data, skb->data, skb->len);
+               /* Copy only the header fields we use in this driver. */
                nskb->dev = skb->dev;
+               nskb->ip_summed = skb->ip_summed;
+               nskb->proto_data_valid = skb->proto_data_valid;
                dev_kfree_skb(skb);
                skb = nskb;
        }
@@ -898,8 +901,11 @@ static int netif_poll(struct net_device 
                                skb_reserve(nskb, 2);
                                skb_put(nskb, skb->len);
                                memcpy(nskb->data, skb->data, skb->len);
+                               /* Copy any other fields we already set up. */
                                nskb->dev = skb->dev;
                                nskb->ip_summed = skb->ip_summed;
+                               nskb->proto_data_valid = skb->proto_data_valid;
+                               nskb->proto_csum_blank = skb->proto_csum_blank;
                        }
 
                        /* Reinitialise and then destroy the old skbuff. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] When we copy packet sin netback/netfront make sure the new skb has, Xen patchbot-unstable <=