Skip to content

Commit

Permalink
[DCCP] ipv6: Fix opt_skb leak.
Browse files Browse the repository at this point in the history
Based upon a patch from Jesper Juhl.  Try to match the
TCP IPv6 code this was copied from as much as possible,
so that it's easy to see where to add the ipv6 pktoptions
support code.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 22, 2006
1 parent 8270953 commit fd169f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
if (sk->sk_state == DCCP_OPEN) { /* Fast path */
if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
goto reset;
if (opt_skb) {
/* This is where we would goto ipv6_pktoptions. */
__kfree_skb(opt_skb);
}
return 0;
}

Expand All @@ -1019,6 +1023,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)

if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len))
goto reset;
if (opt_skb) {
/* This is where we would goto ipv6_pktoptions. */
__kfree_skb(opt_skb);
}
return 0;

reset:
Expand Down

0 comments on commit fd169f1

Please sign in to comment.