Skip to content

Commit

Permalink
[DCCP]: Use skb_set_owner_w in dccp_transmit_skb when skb->sk is NULL
Browse files Browse the repository at this point in the history
David S. Miller <davem@davemloft.net> wrote:
> One thing you can probably do for this bug is to mark data packets
> explicitly somehow, perhaps in the SKB control block DCCP already
> uses for other data.  Put some boolean in there, set it true for
> data packets.  Then change the test in dccp_transmit_skb() as
> appropriate to test the boolean flag instead of "skb_cloned(skb)".

I agree.  In fact we already have that flag, it's called skb->sk.
So here is patch to test that instead of skb_cloned().

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ian McDonald <imcdnzl@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
  • Loading branch information
Herbert Xu authored and Arnaldo Carvalho de Melo committed Oct 20, 2005
1 parent ac9b9c6 commit fda0fd6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)

skb->h.raw = skb_push(skb, dccp_header_size);
dh = dccp_hdr(skb);
/*
* Data packets are not cloned as they are never retransmitted
*/
if (skb_cloned(skb))

if (!skb->sk)
skb_set_owner_w(skb, sk);

/* Build DCCP header and checksum it. */
Expand Down

0 comments on commit fda0fd6

Please sign in to comment.