Re: [PATCH net-next] tcp: Fix tcp_syn_flood_action() if CONFIG_IPV6=n

From: Jakub Kicinski
Date: Mon Nov 21 2022 - 22:52:24 EST


On Mon, 21 Nov 2022 14:44:19 -0800 Saeed Mahameed wrote:
> there's a macro inet6_rcv_saddr(sk), we can use it instead of directly
> referencing &sk->sk_v6_rcv_saddr, it already handles the case where
> CONFIG_IPV6=n
>
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -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),

Great, could you post a full patch? I haven't seen v2, now it's almost
Thanksgiving..