patch-2.1.120 linux/include/linux/skbuff.h

Next file: linux/include/linux/socket.h
Previous file: linux/include/linux/sched.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.119/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
@@ -537,6 +537,19 @@
 	return skb;
 }
 
+extern __inline__ struct sk_buff *
+skb_cow(struct sk_buff *skb, unsigned int headroom)
+{
+	headroom = (headroom+15)&~15;
+
+	if ((unsigned)skb_headroom(skb) < headroom || skb_cloned(skb)) {
+		struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
+		kfree_skb(skb);
+		skb = skb2;
+	}
+	return skb;
+}
+
 extern struct sk_buff *		skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err);
 extern unsigned int		datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait);
 extern int			skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov