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-devel

[Xen-devel] [PATCH] skb_copy_bits() can return err

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] skb_copy_bits() can return err
From: Nivedita Singhvi <niv@xxxxxxxxxx>
Date: Wed, 01 Jun 2005 16:01:56 -0700
Delivery-date: Wed, 01 Jun 2005 23:01:17 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.8 (X11/20041020)
skb_copy_bits() can return an err, so have netif_be_start_xmit()
crash informatively..

thanks,
Nivedita


diff -urN 
xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 
niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c
--- xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c     
2005-05-31 20:12:37.000000000 -0700
+++ niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c     
2005-06-01 15:20:52.954245318 -0700
@@ -153,7 +153,9 @@
             goto drop;
         skb_reserve(nskb, hlen);
         __skb_put(nskb, skb->len);
-        (void)skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen);
+        if (skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen)) {
+               BUG();
+       }
         nskb->dev = skb->dev;
         nskb->proto_csum_valid = skb->proto_csum_valid;
         dev_kfree_skb(skb);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] skb_copy_bits() can return err, Nivedita Singhvi <=