Skip to contentSkip to conversation

tcp: fix build fong CONFIG_MPTCP=n

PATCH Applied Eric Dumazet 3 participants 4 messages Aug 1, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: fix build fong CONFIG_MPTCP=n

Fixes these errors:

net/ipv4/syncookies.c: In function 'tcp_get_cookie_sock':
net/ipv4/syncookies.c:216:19: error: 'struct tcp_request_sock' has no member named 'drop_req'
216 | if (tcp_rsk(req)->drop_req) {
| ^~
net/ipv4/syncookies.c: In function 'cookie_tcp_reqsk_alloc':
net/ipv4/syncookies.c:289:27: warning: unused variable 'treq' [-Wunused-variable]
289 | struct tcp_request_sock *treq;
| ^~~~
make[3]: *** [scripts/Makefile.build:280: net/ipv4/syncookies.o] Error 1 make[3]: *** Waiting for unfinished jobs....

Fixes 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use")
Cc Florian Westphal <[email protected]>
---
 net/ipv4/syncookies.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/syncookies.c +3 -2
index 11b20474be8310d7070750a1c7b4013f2fba2f55..f0794f0232bae749244fff35d8b96b1f561a5e87 100644
@@ -213,7 +213,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
 		tcp_sk(child)->tsoffset = tsoff;
 		sock_rps_save_rxhash(child, skb);
 
-		if (tcp_rsk(req)->drop_req) {
+		if (rsk_drop_req(req)) {
 			refcount_set(&req->rsk_refcnt, 2);
 			return child;
 		}
@@ -286,10 +286,11 @@ struct request_sock *cookie_tcp_reqsk_alloc(const struct request_sock_ops *ops,
 					    struct sock *sk,
 					    struct sk_buff *skb)
 {
-	struct tcp_request_sock *treq;
 	struct request_sock *req;
 
 #ifdef CONFIG_MPTCP
+	struct tcp_request_sock *treq;
+
 	if (sk_is_mptcp(sk))
 		ops = &mptcp_subflow_request_sock_ops;
 #endif
Signature · 1 line
2.28.0.163.g6104cc2f0b6-goog
#1 lore raw
Quoted 12 lines · Eric Dumazet

Fixes these errors:

net/ipv4/syncookies.c: In function 'tcp_get_cookie_sock':
net/ipv4/syncookies.c:216:19: error: 'struct tcp_request_sock' has no member named 'drop_req'
216 | if (tcp_rsk(req)->drop_req) {
| ^~
net/ipv4/syncookies.c: In function 'cookie_tcp_reqsk_alloc':
net/ipv4/syncookies.c:289:27: warning: unused variable 'treq' [-Wunused-variable]
289 | struct tcp_request_sock *treq;
| ^~~~

Ugh, sorry about this.

Quoted 15 lines

make[3]: *** [scripts/Makefile.build:280: net/ipv4/syncookies.o] Error 1 make[3]: *** Waiting for unfinished jobs....

Fixes 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use")
Cc Florian Westphal <[email protected]>
---
 net/ipv4/syncookies.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/syncookies.c +0 -0
index 11b20474be8310d7070750a1c7b4013f2fba2f55..f0794f0232bae749244fff35d8b96b1f561a5e87 100644

net/ipv4/syncookies.c struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, · line 216

Quoted 5 lines
net/ipv4/syncookies.c +1 -1
@@ -213,7 +213,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
 		tcp_sk(child)->tsoffset = tsoff;
 		sock_rps_save_rxhash(child, skb);
 
-		if (tcp_rsk(req)->drop_req) {
+		if (rsk_drop_req(req)) {

This hunk breaks join self test for mptcp, but it should not. Looks like cookie path missed a ->is_mptcp = 1 somewhere. Investigating.

#2 lore raw
Quoted 34 lines · Florian Westphal
Quoted 12 lines · Eric Dumazet

Fixes these errors:

net/ipv4/syncookies.c: In function 'tcp_get_cookie_sock':
net/ipv4/syncookies.c:216:19: error: 'struct tcp_request_sock' has no member named 'drop_req'
216 | if (tcp_rsk(req)->drop_req) {
| ^~
net/ipv4/syncookies.c: In function 'cookie_tcp_reqsk_alloc':
net/ipv4/syncookies.c:289:27: warning: unused variable 'treq' [-Wunused-variable]
289 | struct tcp_request_sock *treq;
| ^~~~

Ugh, sorry about this.

Quoted 18 lines

make[3]: *** [scripts/Makefile.build:280: net/ipv4/syncookies.o] Error 1 make[3]: *** Waiting for unfinished jobs....

Fixes 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use")
Cc Florian Westphal <[email protected]>
---
 net/ipv4/syncookies.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/syncookies.c +0 -0
index 11b20474be8310d7070750a1c7b4013f2fba2f55..f0794f0232bae749244fff35d8b96b1f561a5e87 100644
@@ -213,7 +213,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
 		tcp_sk(child)->tsoffset = tsoff;
 		sock_rps_save_rxhash(child, skb);
 
Quoted 5 lines

net/ipv4/syncookies.c struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb, · line 216

Quoted 2 lines
net/ipv4/syncookies.c +1 -1
-		if (tcp_rsk(req)->drop_req) {
+		if (rsk_drop_req(req)) {

This hunk breaks join self test for mptcp, but it should not. Looks like cookie path missed a ->is_mptcp = 1 somewhere. Investigating.

I take that back, the failure is spurious, also sometimes occurs with no-cookie part of test and also happens with a checkout before the syncookie patches got merged. I will take another look at this on Monday. No need to hold up this fix, so

maintainer Applied
#3 lore raw
In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Fri, 31 Jul 2020 19:09:29 -0700

Quoted 15 lines

Fixes these errors:

net/ipv4/syncookies.c: In function 'tcp_get_cookie_sock':
net/ipv4/syncookies.c:216:19: error: 'struct tcp_request_sock' has no member named 'drop_req'
216 | if (tcp_rsk(req)->drop_req) {
| ^~
net/ipv4/syncookies.c: In function 'cookie_tcp_reqsk_alloc':
net/ipv4/syncookies.c:289:27: warning: unused variable 'treq' [-Wunused-variable]
289 | struct tcp_request_sock *treq;
| ^~~~
make[3]: *** [scripts/Makefile.build:280: net/ipv4/syncookies.o] Error 1 make[3]: *** Waiting for unfinished jobs....

Quoted 3 lines
Fixes 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use")
Cc Florian Westphal <[email protected]>

Applied, thank you.