Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66609
b: refs/heads/master
c: 5288605
h: refs/heads/master
i:
  66607: a5635dd
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 10, 2007
1 parent eac90b2 commit 91d4099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0cfad07555312468296ea3bbbcdf99038f58678b
refs/heads/master: 52886051ffdc087a4f7f11540395fd64040101ad
18 changes: 8 additions & 10 deletions trunk/net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
#ifdef CONFIG_INET
new->sp = secpath_get(old->sp);
#endif
new->csum_start = old->csum_start;
new->csum_offset = old->csum_offset;
new->ip_summed = old->ip_summed;
new->transport_header = old->transport_header;
new->network_header = old->network_header;
new->mac_header = old->mac_header;
Expand Down Expand Up @@ -545,8 +548,6 @@ struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
skb_reserve(n, headerlen);
/* Set the tail pointer and length */
skb_put(n, skb->len);
n->csum = skb->csum;
n->ip_summed = skb->ip_summed;

if (skb_copy_bits(skb, -headerlen, n->head, headerlen + skb->len))
BUG();
Expand Down Expand Up @@ -589,8 +590,6 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
skb_put(n, skb_headlen(skb));
/* Copy the bytes */
skb_copy_from_linear_data(skb, n->data, n->len);
n->csum = skb->csum;
n->ip_summed = skb->ip_summed;

n->truesize += skb->data_len;
n->data_len = skb->data_len;
Expand Down Expand Up @@ -686,6 +685,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
skb->transport_header += off;
skb->network_header += off;
skb->mac_header += off;
skb->csum_start += off;
skb->cloned = 0;
skb->hdr_len = 0;
skb->nohdr = 0;
Expand Down Expand Up @@ -734,9 +734,6 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
*
* You must pass %GFP_ATOMIC as the allocation priority if this function
* is called from an interrupt.
*
* BUG ALERT: ip_summed is not copied. Why does this work? Is it used
* only by netfilter in the cases when checksum is recalculated? --ANK
*/
struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
int newheadroom, int newtailroom,
Expand All @@ -749,7 +746,7 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
gfp_mask);
int oldheadroom = skb_headroom(skb);
int head_copy_len, head_copy_off;
int off = 0;
int off;

if (!n)
return NULL;
Expand All @@ -773,12 +770,13 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,

copy_skb_header(n, skb);

#ifdef NET_SKBUFF_DATA_USES_OFFSET
off = newheadroom - oldheadroom;
#endif
n->csum_start += off;
#ifdef NET_SKBUFF_DATA_USES_OFFSET
n->transport_header += off;
n->network_header += off;
n->mac_header += off;
#endif

return n;
}
Expand Down

0 comments on commit 91d4099

Please sign in to comment.