patch-1.3.8 linux/net/core/skbuff.c

Next file: linux/net/core/sock.c
Previous file: linux/net/core/dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.7/linux/net/core/skbuff.c linux/net/core/skbuff.c
@@ -613,6 +613,7 @@
 	n->when=skb->when;
 	n->dev=skb->dev;
 	n->h.raw=skb->h.raw+offset;
+	n->mac.raw=skb->mac.raw+offset;
 	n->ip_hdr=(struct iphdr *)(((char *)skb->ip_hdr)+offset);
 	n->saddr=skb->saddr;
 	n->daddr=skb->daddr;
@@ -674,8 +675,11 @@
 
 struct sk_buff *dev_alloc_skb(unsigned int length)
 {
-	struct sk_buff *skb=alloc_skb(length+16, GFP_ATOMIC);
-	skb_reserve(skb,16);
+	struct sk_buff *skb;
+
+	skb = alloc_skb(length+16, GFP_ATOMIC);
+	if (skb)
+		skb_reserve(skb,16);
 	return skb;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this