diff options
author | Vijay Subramanian <subramanian.vijay@gmail.com> | 2013-09-03 15:23:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 00:27:28 -0400 |
commit | c995ae2259ee36caf48bbfacf40111998dacd4af (patch) | |
tree | dbe9be79766ab1c2a4f9da7ae461bd6ceab6bc9f | |
parent | cc8c6c1b21c9b1e0f1e89428c07c7c52435cba0c (diff) |
tcp: Change return value of tcp_rcv_established()
tcp_rcv_established() returns only one value namely 0. We change the return
value to void (as suggested by David Miller).
After commit 0c24604b (tcp: implement RFC 5961 4.2), we no longer send RSTs in
response to SYNs. We can remove the check and processing on the return value of
tcp_rcv_established().
We also fix jtcp_rcv_established() in tcp_probe.c to match that of
tcp_rcv_established().
Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/tcp.h | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 13 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 5 | ||||
-rw-r--r-- | net/ipv4/tcp_probe.c | 5 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 3 |
5 files changed, 12 insertions, 18 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6a6a88db462d..b1aa324c5e65 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -371,8 +371,8 @@ extern void tcp_delack_timer_handler(struct sock *sk); | |||
371 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 371 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
372 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 372 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
373 | const struct tcphdr *th, unsigned int len); | 373 | const struct tcphdr *th, unsigned int len); |
374 | extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 374 | extern void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
375 | const struct tcphdr *th, unsigned int len); | 375 | const struct tcphdr *th, unsigned int len); |
376 | extern void tcp_rcv_space_adjust(struct sock *sk); | 376 | extern void tcp_rcv_space_adjust(struct sock *sk); |
377 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | 377 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); |
378 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); | 378 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 1a84fffe6993..93d7e9de4143 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5049,8 +5049,8 @@ discard: | |||
5049 | * the rest is checked inline. Fast processing is turned on in | 5049 | * the rest is checked inline. Fast processing is turned on in |
5050 | * tcp_data_queue when everything is OK. | 5050 | * tcp_data_queue when everything is OK. |
5051 | */ | 5051 | */ |
5052 | int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 5052 | void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
5053 | const struct tcphdr *th, unsigned int len) | 5053 | const struct tcphdr *th, unsigned int len) |
5054 | { | 5054 | { |
5055 | struct tcp_sock *tp = tcp_sk(sk); | 5055 | struct tcp_sock *tp = tcp_sk(sk); |
5056 | 5056 | ||
@@ -5127,7 +5127,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
5127 | tcp_ack(sk, skb, 0); | 5127 | tcp_ack(sk, skb, 0); |
5128 | __kfree_skb(skb); | 5128 | __kfree_skb(skb); |
5129 | tcp_data_snd_check(sk); | 5129 | tcp_data_snd_check(sk); |
5130 | return 0; | 5130 | return; |
5131 | } else { /* Header too small */ | 5131 | } else { /* Header too small */ |
5132 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS); | 5132 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS); |
5133 | goto discard; | 5133 | goto discard; |
@@ -5220,7 +5220,7 @@ no_ack: | |||
5220 | if (eaten) | 5220 | if (eaten) |
5221 | kfree_skb_partial(skb, fragstolen); | 5221 | kfree_skb_partial(skb, fragstolen); |
5222 | sk->sk_data_ready(sk, 0); | 5222 | sk->sk_data_ready(sk, 0); |
5223 | return 0; | 5223 | return; |
5224 | } | 5224 | } |
5225 | } | 5225 | } |
5226 | 5226 | ||
@@ -5236,7 +5236,7 @@ slow_path: | |||
5236 | */ | 5236 | */ |
5237 | 5237 | ||
5238 | if (!tcp_validate_incoming(sk, skb, th, 1)) | 5238 | if (!tcp_validate_incoming(sk, skb, th, 1)) |
5239 | return 0; | 5239 | return; |
5240 | 5240 | ||
5241 | step5: | 5241 | step5: |
5242 | if (tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT) < 0) | 5242 | if (tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT) < 0) |
@@ -5252,7 +5252,7 @@ step5: | |||
5252 | 5252 | ||
5253 | tcp_data_snd_check(sk); | 5253 | tcp_data_snd_check(sk); |
5254 | tcp_ack_snd_check(sk); | 5254 | tcp_ack_snd_check(sk); |
5255 | return 0; | 5255 | return; |
5256 | 5256 | ||
5257 | csum_error: | 5257 | csum_error: |
5258 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_CSUMERRORS); | 5258 | TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_CSUMERRORS); |
@@ -5260,7 +5260,6 @@ csum_error: | |||
5260 | 5260 | ||
5261 | discard: | 5261 | discard: |
5262 | __kfree_skb(skb); | 5262 | __kfree_skb(skb); |
5263 | return 0; | ||
5264 | } | 5263 | } |
5265 | EXPORT_SYMBOL(tcp_rcv_established); | 5264 | EXPORT_SYMBOL(tcp_rcv_established); |
5266 | 5265 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 09d45d718973..b14266bb91eb 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) | |||
1799 | sk->sk_rx_dst = NULL; | 1799 | sk->sk_rx_dst = NULL; |
1800 | } | 1800 | } |
1801 | } | 1801 | } |
1802 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) { | 1802 | tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len); |
1803 | rsk = sk; | ||
1804 | goto reset; | ||
1805 | } | ||
1806 | return 0; | 1803 | return 0; |
1807 | } | 1804 | } |
1808 | 1805 | ||
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 1f6aa543b64e..611beab38a00 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c | |||
@@ -122,8 +122,8 @@ static inline int tcp_probe_avail(void) | |||
122 | * Hook inserted to be called before each receive packet. | 122 | * Hook inserted to be called before each receive packet. |
123 | * Note: arguments must match tcp_rcv_established()! | 123 | * Note: arguments must match tcp_rcv_established()! |
124 | */ | 124 | */ |
125 | static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 125 | static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
126 | const struct tcphdr *th, unsigned int len) | 126 | const struct tcphdr *th, unsigned int len) |
127 | { | 127 | { |
128 | const struct tcp_sock *tp = tcp_sk(sk); | 128 | const struct tcp_sock *tp = tcp_sk(sk); |
129 | const struct inet_sock *inet = inet_sk(sk); | 129 | const struct inet_sock *inet = inet_sk(sk); |
@@ -172,7 +172,6 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
172 | } | 172 | } |
173 | 173 | ||
174 | jprobe_return(); | 174 | jprobe_return(); |
175 | return 0; | ||
176 | } | 175 | } |
177 | 176 | ||
178 | static struct jprobe tcp_jprobe = { | 177 | static struct jprobe tcp_jprobe = { |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5bcfadf09e95..9acdcedf9a14 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) | |||
1360 | } | 1360 | } |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) | 1363 | tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len); |
1364 | goto reset; | ||
1365 | if (opt_skb) | 1364 | if (opt_skb) |
1366 | goto ipv6_pktoptions; | 1365 | goto ipv6_pktoptions; |
1367 | return 0; | 1366 | return 0; |