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

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



# 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


 


Rackspace

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