diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 03e6b7a2bc53..a3f559162521 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -349,7 +349,7 @@ static void tcp_v6_mtu_reduced(struct sock *sk) | |||
349 | } | 349 | } |
350 | } | 350 | } |
351 | 351 | ||
352 | static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | 352 | static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
353 | u8 type, u8 code, int offset, __be32 info) | 353 | u8 type, u8 code, int offset, __be32 info) |
354 | { | 354 | { |
355 | const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data; | 355 | const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data; |
@@ -371,17 +371,19 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
371 | if (!sk) { | 371 | if (!sk) { |
372 | __ICMP6_INC_STATS(net, __in6_dev_get(skb->dev), | 372 | __ICMP6_INC_STATS(net, __in6_dev_get(skb->dev), |
373 | ICMP6_MIB_INERRORS); | 373 | ICMP6_MIB_INERRORS); |
374 | return; | 374 | return -ENOENT; |
375 | } | 375 | } |
376 | 376 | ||
377 | if (sk->sk_state == TCP_TIME_WAIT) { | 377 | if (sk->sk_state == TCP_TIME_WAIT) { |
378 | inet_twsk_put(inet_twsk(sk)); | 378 | inet_twsk_put(inet_twsk(sk)); |
379 | return; | 379 | return 0; |
380 | } | 380 | } |
381 | seq = ntohl(th->seq); | 381 | seq = ntohl(th->seq); |
382 | fatal = icmpv6_err_convert(type, code, &err); | 382 | fatal = icmpv6_err_convert(type, code, &err); |
383 | if (sk->sk_state == TCP_NEW_SYN_RECV) | 383 | if (sk->sk_state == TCP_NEW_SYN_RECV) { |
384 | return tcp_req_err(sk, seq, fatal); | 384 | tcp_req_err(sk, seq, fatal); |
385 | return 0; | ||
386 | } | ||
385 | 387 | ||
386 | bh_lock_sock(sk); | 388 | bh_lock_sock(sk); |
387 | if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG) | 389 | if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG) |
@@ -467,6 +469,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
467 | out: | 469 | out: |
468 | bh_unlock_sock(sk); | 470 | bh_unlock_sock(sk); |
469 | sock_put(sk); | 471 | sock_put(sk); |
472 | return 0; | ||
470 | } | 473 | } |
471 | 474 | ||
472 | 475 | ||