Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1260
b: refs/heads/master
c: 2fdba6b
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed May 19, 2005
1 parent 65606f6 commit 8769832
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 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: d48102007d068df7ba3055cdc1723e12db1ba30f
refs/heads/master: 2fdba6b085eb7068e9594cfa55ffe40466184b4d
8 changes: 8 additions & 0 deletions trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
/* Partially cloned skb? */
if (skb_shared(frag))
goto slow_path;

BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
}

/* Everything is OK. Generate! */
Expand Down
14 changes: 8 additions & 6 deletions trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,17 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
skb_headroom(frag) < hlen)
goto slow_path;

/* Correct socket ownership. */
if (frag->sk == NULL)
goto slow_path;

/* Partially cloned skb? */
if (skb_shared(frag))
goto slow_path;

BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
}

err = 0;
Expand Down Expand Up @@ -1116,12 +1120,10 @@ int ip6_push_pending_frames(struct sock *sk)
tail_skb = &(tmp_skb->next);
skb->len += tmp_skb->len;
skb->data_len += tmp_skb->len;
#if 0 /* Logically correct, but useless work, ip_fragment() will have to undo */
skb->truesize += tmp_skb->truesize;
__sock_put(tmp_skb->sk);
tmp_skb->destructor = NULL;
tmp_skb->sk = NULL;
#endif
}

ipv6_addr_copy(final_dst, &fl->fl6_dst);
Expand Down

0 comments on commit 8769832

Please sign in to comment.