tcp: Fix build break when CONFIG_IPV6=n
Subsystems (3)
PATCH v2 1/1 tcp: Fix build break when CONFIG_IPV6=n
From: Saeed Mahameed <[email protected]>
The cited commit caused the following build break when CONFIG_IPV6 was disabled
net/ipv4/tcp_input.c: In function ‘tcp_syn_flood_action’:include/net/sock.h:387:37: error: ‘const struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’?
Fix by using inet6_rcv_saddr() macro which handles this situation nicely.
---
v1->v2:
- Keep IS_ENABLED(CONFIG_IPV6) in the if condition
net/ipv4/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_input.c +1 -1
@@ -6845,7 +6845,7 @@ static bool tcp_syn_flood_action(const struct sock *sk, const char *proto) xchg(&queue->synflood_warned, 1) == 0) {if (IS_ENABLED (CONFIG_IPV6 ) && sk->sk_family ==AF_INET6 ) {net_info_ratelimited ("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n" , - proto, &sk->sk_v6_rcv_saddr, + proto,inet6_rcv_saddr (sk), sk->sk_num, msg); }else { net_info_ratelimited("%s: Possible SYN flooding on port %pI4:%u. %s.\n",
Signature · 1 line
2.38.1
Quoted 9 lines · Saeed Mahameed
From: Saeed Mahameed <[email protected]>
The cited commit caused the following build break when
CONFIG_IPV6was disabled
net/ipv4/tcp_input.c: In function ‘tcp_syn_flood_action’:include/net/sock.h:387:37: error: ‘const struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’?
Quoted 8 lines
Fix by using
inet6_rcv_saddr()macro which handles this situation nicely.Fixes d9282e48c608 ("tcp: Add listening address to SYN flood message")Signed-off-by Saeed Mahameed <[email protected]>Reported-by Geert Uytterhoeven <[email protected]>CC Matthieu Baerts <[email protected]>CC Jamie Bainbridge <[email protected]>
Thanks.
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 22 Nov 2022 10:41:58 -0800 you wrote:
From: Saeed Mahameed <[email protected]>
The cited commit caused the following build break when
CONFIG_IPV6was disabled
net/ipv4/tcp_input.c: In function ‘tcp_syn_flood_action’:include/net/sock.h:387:37: error: ‘const struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’?[...]
Here is the summary with links:
- [net-next,V2] tcp: Fix build break when CONFIG_IPV6=n
https://git.kernel.org/netdev/net-next/c/c90b6b1005ec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html