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

[Xen-changelog] failing more nicely when trying to allocate too big packet



# HG changeset patch
# User vh249@xxxxxxxxxxxxxxxxxxxxxx
# Node ID d1a7b01d85b627906560f45e08db749993b092cc
# Parent  35801a414624343b727b87469e4cc6903c6b0db7
failing more nicely when trying to allocate too big packet

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r 35801a414624 -r d1a7b01d85b6 
linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Mon Aug 15 12:13:41 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Wed Aug 17 21:49:24 2005
@@ -27,6 +27,11 @@
 struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
 {
     struct sk_buff *skb;
+
+    if (unlikely(length + 16 > PAGE_SIZE)) {
+        printk(KERN_ERR "error: allocating skb: too big packet (%d)\n", 
length);
+        return NULL;
+    }
     skb = alloc_skb_from_cache(skbuff_cachep, length + 16, gfp_mask);
     if ( likely(skb != NULL) )
         skb_reserve(skb, 16);

_______________________________________________
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®.