[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.