patch-2.1.11 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
- Lines: 48
- Date:
Mon Nov 18 15:11:13 1996
- Orig file:
v2.1.10/linux/include/linux/skbuff.h
- Orig date:
Fri Nov 15 23:49:10 1996
diff -u --recursive --new-file v2.1.10/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
@@ -184,6 +184,16 @@
return (list->next == (struct sk_buff *) list);
}
+extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri, int dir)
+{
+ struct sk_buff *nskb;
+ if(skb->users==1)
+ return skb;
+ nskb=skb_copy(skb, pri);
+ kfree_skb(skb, dir); /* Free our shared copy */
+ return nskb;
+}
+
/*
* Peek an sk_buff. Unlike most other operations you _MUST_
* be careful with this one. A peek leaves the buffer on the
@@ -402,13 +412,14 @@
extern __inline__ unsigned char *skb_put(struct sk_buff *skb, int len)
{
+ extern char *skb_put_errstr;
unsigned char *tmp=skb->tail;
skb->tail+=len;
skb->len+=len;
if(skb->tail>skb->end)
{
__label__ here;
- panic("skput:over: %p:%d", &&here,len);
+ panic(skb_put_errstr,&&here,len);
here:
}
return tmp;
@@ -416,12 +427,13 @@
extern __inline__ unsigned char *skb_push(struct sk_buff *skb, int len)
{
+ extern char *skb_push_errstr;
skb->data-=len;
skb->len+=len;
if(skb->data<skb->head)
{
__label__ here;
- panic("skpush:under: %p:%d", &&here,len);
+ panic(skb_push_errstr, &&here,len);
here:
}
return skb->data;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov