netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: Remove needless check of return value
@ 2013-08-30  1:19 Vijay Subramanian
  2013-08-30  1:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vijay Subramanian @ 2013-08-30  1:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, Vijay Subramanian

After commit 0c24604b (tcp: implement RFC 5961 4.2), tcp_rcv_established() only
returns 0 since we no longer send RSTs in response to SYNs. We can remove the
check on the return value.

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
 net/ipv4/tcp_ipv4.c |    5 +----
 net/ipv6/tcp_ipv6.c |    3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 09d45d7..b14266b 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1799,10 +1799,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb)
 				sk->sk_rx_dst = NULL;
 			}
 		}
-		if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) {
-			rsk = sk;
-			goto reset;
-		}
+		tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len);
 		return 0;
 	}
 
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5bcfadf..9acdced 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1360,8 +1360,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
 			}
 		}
 
-		if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len))
-			goto reset;
+		tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len);
 		if (opt_skb)
 			goto ipv6_pktoptions;
 		return 0;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] tcp: Remove needless check of return value
  2013-08-30  1:19 [PATCH net-next] tcp: Remove needless check of return value Vijay Subramanian
@ 2013-08-30  1:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-30  1:36 UTC (permalink / raw)
  To: subramanian.vijay; +Cc: netdev, eric.dumazet

From: Vijay Subramanian <subramanian.vijay@gmail.com>
Date: Thu, 29 Aug 2013 18:19:18 -0700

> After commit 0c24604b (tcp: implement RFC 5961 4.2), tcp_rcv_established() only
> returns 0 since we no longer send RSTs in response to SYNs. We can remove the
> check on the return value.
> 
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>

Always returning the same value is the same as returning no value at all.

Make tcp_rcv_established() return void please.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-30  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30  1:19 [PATCH net-next] tcp: Remove needless check of return value Vijay Subramanian
2013-08-30  1:36 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).