From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09617C4332F for ; Tue, 22 Nov 2022 18:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234284AbiKVSaL (ORCPT ); Tue, 22 Nov 2022 13:30:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233677AbiKVSaK (ORCPT ); Tue, 22 Nov 2022 13:30:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7656D5DBBD for ; Tue, 22 Nov 2022 10:30:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 301C0B81D2C for ; Tue, 22 Nov 2022 18:30:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA601C433C1; Tue, 22 Nov 2022 18:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669141806; bh=UG9uKD1tv66OhEDb3l+yBrmeQtYL23MCcMh6/vmEMB0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pxUu9Jp3hc/n/PGyOHHdgePnXe1srOKEvUk3zTvXNMySMYRCwofs/OHq4isR7HMiE 39z2yvv7JRkCn0CYcOQc95W9Dk1e9o8ZRKDLcwSlAhZ0KJjyJeY/nKgxOtl+BCCghY MqomrhcWOLTvEdv/9Gct1nUSJmhQdAKpZISkmQGv+lnMektefx5FzYmCtlEHFaVZTF bbVX72ADUD8h+/GlsuYUS0WrblM6skP/l0LjQHEj9GblIVb/oMn8cWOxpSwEZxVwUT apmMs155UImVIwe0/yzbfZVUp//fcnSfAk+PdkWwtckJGTqHbqmcNx9G4DNmLejYKv RiUpz8zYZ72FQ== Date: Tue, 22 Nov 2022 10:30:05 -0800 From: Saeed Mahameed To: Eric Dumazet Cc: Geert Uytterhoeven , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Geert Uytterhoeven , Matthieu Baerts , Jamie Bainbridge Subject: Re: [PATCH net-next] tcp: Fix build break when CONFIG_IPV6=n Message-ID: References: <20221122093131.161499-1-saeed@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 22 Nov 08:42, Eric Dumazet wrote: >On Tue, Nov 22, 2022 at 1:37 AM Geert Uytterhoeven wrote: >> >> Hi Saeed, >> >> On Tue, Nov 22, 2022 at 10:31 AM Saeed Mahameed wrote: >> > From: Saeed Mahameed >> > >> > 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 >> >> Thanks for your patch! >> >> > --- a/net/ipv4/tcp_input.c >> > +++ b/net/ipv4/tcp_input.c >> > @@ -6843,9 +6843,9 @@ static bool tcp_syn_flood_action(const struct sock *sk, const char *proto) >> > >> > if (!READ_ONCE(queue->synflood_warned) && syncookies != 2 && >> > xchg(&queue->synflood_warned, 1) == 0) { >> > - if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) { >> > + if (sk->sk_family == AF_INET6) { >> >> I think the IS_ENABLED() should stay, to make sure the IPV6-only >> code is optimized away when IPv6-support is disabled. > >Agreed. sending V2. but for the record, I don't think such a user exist. Simply if you care about such micro optimization, then you are serious enough not to disable IPv6.