]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tcp: Fix build break when CONFIG_IPV6=n
authorSaeed Mahameed <saeedm@nvidia.com>
Tue, 22 Nov 2022 18:41:58 +0000 (10:41 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Nov 2022 04:41:31 +0000 (20:41 -0800)
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.

Fixes: d9282e48c608 ("tcp: Add listening address to SYN flood message")
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
CC: Matthieu Baerts <matthieu.baerts@tessares.net>
CC: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20221122184158.170798-1-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c

index 0ae291e53eab228ce171cd73abafc009d99b886d..1efacbe948da4617bb5ff5d77e4dc6fb8647a8fd 100644 (file)
@@ -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",