34,6 → 34,7 |
skb->head = skb->data; |
skb->tail = skb->data; |
skb->len = 0; |
skb->truesize = len; |
|
return skb; |
} |
40,7 → 41,9 |
|
void skb_reserve(struct sk_buff *skb, int len) |
{ |
/* Do nothing... */ |
/* changed by PJ ... before it did nothing... */ |
skb->data+=len; |
skb->tail+=len; |
} |
|
unsigned char *skb_put(struct sk_buff *skb, int len) |
59,3 → 62,53 |
list->next = (struct sk_buff *)list; |
list->qlen = 0; |
} |
|
struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, int newheadroom) |
{ |
struct sk_buff *n; |
unsigned long offset; |
int headroom = skb_headroom(skb); |
|
/* |
* Allocate the copy buffer |
*/ |
|
n=alloc_skb(skb->truesize+newheadroom-headroom, GFP_ATOMIC); |
if(n==NULL) |
return NULL; |
|
skb_reserve(n,newheadroom); |
|
/* |
* Shift between the two data areas in bytes |
*/ |
|
offset=n->data-skb->data; |
|
/* Set the tail pointer and length */ |
skb_put(n,skb->len); |
/* Copy the bytes */ |
memcpy(n->data,skb->data,skb->len); |
n->list=NULL; |
// n->sk=NULL; |
// n->priority=skb->priority; |
n->protocol=skb->protocol; |
n->dev=skb->dev; |
// n->dst=dst_clone(skb->dst); |
// n->h.raw=skb->h.raw+offset; |
// n->nh.raw=skb->nh.raw+offset; |
// n->mac.raw=skb->mac.raw+offset; |
memcpy(n->cb, skb->cb, sizeof(skb->cb)); |
n->used=skb->used; |
// n->is_clone=0; |
// atomic_set(&n->users, 1); |
// n->pkt_type=skb->pkt_type; |
// n->stamp=skb->stamp; |
// n->destructor = NULL; |
// n->security=skb->security; |
#ifdef CONFIG_IP_FIREWALL |
n->fwmark = skb->fwmark; |
#endif |
|
return n; |
} |