]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
commit 07cdd1e308ea2ca6339387d5a9dc8041ae7cad04
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Fri, 19 Jun 2009 14:34:57 +0000 (15:34 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 12:02:13 +0000 (13:02 +0100)
Author: Jose Renato Santos <jsantos@hpl.hp.com>
Date:   Thu Jun 11 12:27:22 2009 -0700

    Set skb protocol field only after grant operations are completed.
    Otherwise it will be corrupted when the header is not inline and
    thus it has not been copied yet.

Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com>
drivers/xen/netchannel2/recv_packet.c

index 0a1fb9d45105a2b44ff9641caadbac0bf2a416d8..2a2398fd561f48b95f27506d8e4914a9f1d484c4 100644 (file)
@@ -252,7 +252,7 @@ void nc2_handle_packet_msg(struct netchannel2 *nc,
                                  msg.segmentation_type);
                         goto err;
                 }
-                skb->protocol = eth_type_trans(skb, nc->net_device);
+
                 __skb_queue_tail(&pending_rx_queue, skb);
         }
         return;
@@ -294,8 +294,10 @@ void receive_pending_skbs(void)
                 sco = get_skb_overlay(skb);
                 if (unlikely(sco->failed))
                         kfree_skb(skb);
-                else
+                else {
+                       skb->protocol = eth_type_trans(skb, skb->dev);
                         netif_receive_skb(skb);
+               }
         }
 }