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 packets in netback/netfront make sure the n

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] When we copy packets in netback/netfront make sure the new skb has
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2006 09:38:26 +0000
Delivery-date: Thu, 11 May 2006 02:42:00 -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 09dbe36de14491f51f33b33ff7c7c8ea04937355
# Parent  5da82db00c6e6dfa8dd33809c8fab94376635ad3
When we copy packets in 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>
xen-unstable changeset:   9972:91c77df11b43894a2940b03029be46f6a1c85319
xen-unstable date:        Wed May 10 17:30:42 2006 +0100
---
 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 5da82db00c6e -r 09dbe36de144 
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:48:12 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Wed May 10 
17:32:22 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 5da82db00c6e -r 09dbe36de144 
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:48:12 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed May 10 
17:32:22 2006 +0100
@@ -663,7 +663,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;
        }
@@ -895,8 +898,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 packets in netback/netfront make sure the new skb has, Xen patchbot-3 . 0-testing <=