Message ID | 166807341463.2904467.10141806642379634063.stgit@warthog.procyon.org.uk |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp46962wru; Thu, 10 Nov 2022 01:47:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5BGDxosjugmrlGodIGeKX7hnjHCdVt/C9oFk2D+jrN0tDYZaodE1c6I4scojcqASd63o4q X-Received: by 2002:a17:907:86a2:b0:7ae:6d34:d37b with SMTP id qa34-20020a17090786a200b007ae6d34d37bmr14699127ejc.750.1668073655910; Thu, 10 Nov 2022 01:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668073655; cv=none; d=google.com; s=arc-20160816; b=kVS9EkxeLphie+gbix8d5emNcmytJwncKvaod06gjTtaPJbmLe69q3yfhTwcR+GtjR m40tU+gz0mbqEFy6lFChDEFGuPFphzH8D8u63dwV00ML+Lz+ALGcCZ8BbwjNSrk1XPoy dZc/joGQ95AOlCKT7HZ9BEYEmUj+EAmFJLWf2M+v/47lpWFtUv+KqYuEZdprbXoiXgMh jI0uzAi/VN5zHRbXICMoYWw9W0vd2rJiC6SEdnul79yP56LDKcz325AN+k9ym7fh7WfC x7+IDgBKmmu8eCHWLqMWHhUXrCP/Ize8fAxWivwjtDVBhi+qTINllbe+4/CC4qE/pSg2 OEPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:organization :dkim-signature; bh=4ZaRcF8WI9Tne3FYST1W1k4nO0dwOoYM2AmTRWkoH5o=; b=p6NiBsVCXvNbg7yGTi25l+1IXwWtFp/UWWA6UYI1d/daGPrKsfO+fNOPAm5pIgYiFe zsEzIh2awAAVRqLxP22AwDGtXinklzW3BboQDvAq6uXGmDzyyVGaXof1T/r8zQvjb37y B9juMUb6Ec5sgWAKUgMPCMQT71HK8rVrlDOBnmYlN4Pm7jBm2+4Vc15m6tQNpKwiz4vk AmdwMVdYRqLQgAAxAN5tDqcBo+to4nBVXV9r62h9OKzRQl6LTcJUkysJdsfG09arZf/+ +W4qbA7PJ3LePditBxJqFtSW56sA54sCkqurQs+tpmsXMvCBlKgmCQg21zEj5uOZSxmg hWgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VIehum8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i30-20020a50d75e000000b0045cc02ce2aasi16665289edj.319.2022.11.10.01.47.11; Thu, 10 Nov 2022 01:47:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VIehum8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbiKJJoi (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 04:44:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiKJJoh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 04:44:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D3D12D31 for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 01:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668073420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ZaRcF8WI9Tne3FYST1W1k4nO0dwOoYM2AmTRWkoH5o=; b=VIehum8fjN8w3j0Eye5ysp/nR3cGfE8ESIs2+ZGfyhpHOy5IPa8ypsigvp5O7jKKYiEbct TDY3u7ENOpbLmbNxRoDmuZ+TTBrxRWsHP97Bmqsb/CBKShKb6rQkoTaXdi53SHmyM7QsXc MC1PHRkV4aPLS4tuTlTZ0uWd8pPxPbk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-iivNsXE6NhaXahNe1XOXkw-1; Thu, 10 Nov 2022 04:43:37 -0500 X-MC-Unique: iivNsXE6NhaXahNe1XOXkw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57A3C85A583; Thu, 10 Nov 2022 09:43:36 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9670B7AE5; Thu, 10 Nov 2022 09:43:35 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH net-next] rxrpc: Fix missing IPV6 #ifdef From: David Howells <dhowells@redhat.com> To: netdev@vger.kernel.org Cc: kernel test robot <lkp@intel.com>, Marc Dionne <marc.dionne@auristor.com>, linux-afs@lists.infradead.org, dhowells@redhat.com, linux-kernel@vger.kernel.org Date: Thu, 10 Nov 2022 09:43:34 +0000 Message-ID: <166807341463.2904467.10141806642379634063.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749102001975735234?= X-GMAIL-MSGID: =?utf-8?q?1749102001975735234?= |
Series |
[net-next] rxrpc: Fix missing IPV6 #ifdef
|
|
Commit Message
David Howells
Nov. 10, 2022, 9:43 a.m. UTC
Fix rxrpc_encap_err_rcv() to make the call to ipv6_icmp_error conditional
on IPV6 support being enabled.
Fixes: b6c66c4324e7 ("rxrpc: Use the core ICMP/ICMP6 parsers")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
---
net/rxrpc/local_object.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Hi, 2022年11月10日(木) 18:44 David Howells <dhowells@redhat.com>: > > Fix rxrpc_encap_err_rcv() to make the call to ipv6_icmp_error conditional > on IPV6 support being enabled. > > Fixes: b6c66c4324e7 ("rxrpc: Use the core ICMP/ICMP6 parsers") > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: David Howells <dhowells@redhat.com> > cc: Marc Dionne <marc.dionne@auristor.com> > cc: linux-afs@lists.infradead.org > cc: netdev@vger.kernel.org > --- > > net/rxrpc/local_object.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c > index a178f71e5082..25cdfcf7b415 100644 > --- a/net/rxrpc/local_object.c > +++ b/net/rxrpc/local_object.c > @@ -33,7 +33,9 @@ static void rxrpc_encap_err_rcv(struct sock *sk, struct sk_buff *skb, int err, > { > if (ip_hdr(skb)->version == IPVERSION) > return ip_icmp_error(sk, skb, err, port, info, payload); > +#ifdef CONFIG_AF_RXRPC_IPV6 > return ipv6_icmp_error(sk, skb, err, port, info, payload); > +#endif > } > Because this introduces a missing return literally without CONFIG_AF_RXRPC_IPV6, I would prefer #ifdef / #else for the whole function. --yoshfuji > /* > >
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com> wrote: > Because this introduces a missing return literally without > CONFIG_AF_RXRPC_IPV6, I would prefer #ifdef / #else for the whole function. They're both void functions, so actually, there's nothing to return. David
On Thu, Nov 10, 2022 at 09:43:34AM +0000, David Howells wrote: > Fix rxrpc_encap_err_rcv() to make the call to ipv6_icmp_error conditional > on IPV6 support being enabled. > > Fixes: b6c66c4324e7 ("rxrpc: Use the core ICMP/ICMP6 parsers") > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: David Howells <dhowells@redhat.com> > cc: Marc Dionne <marc.dionne@auristor.com> > cc: linux-afs@lists.infradead.org > cc: netdev@vger.kernel.org > --- > > net/rxrpc/local_object.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c > index a178f71e5082..25cdfcf7b415 100644 > --- a/net/rxrpc/local_object.c > +++ b/net/rxrpc/local_object.c > @@ -33,7 +33,9 @@ static void rxrpc_encap_err_rcv(struct sock *sk, struct sk_buff *skb, int err, > { > if (ip_hdr(skb)->version == IPVERSION) > return ip_icmp_error(sk, skb, err, port, info, payload); > +#ifdef CONFIG_AF_RXRPC_IPV6 > return ipv6_icmp_error(sk, skb, err, port, info, payload); > +#endif Can this be if (IS_ENABLED(CONFIG_AF_RXRPC_IPV6) {} rather than #ifdef? It gives better build testing. Andrew
Andrew Lunn <andrew@lunn.ch> wrote: > > +#ifdef CONFIG_AF_RXRPC_IPV6 > > return ipv6_icmp_error(sk, skb, err, port, info, payload); > > +#endif > > Can this be if (IS_ENABLED(CONFIG_AF_RXRPC_IPV6) {} rather than > #ifdef? It gives better build testing. Sure. Does it actually make that much of a difference? I guess the declaration is there even if IPV6 is disabled. David
On Thu, Nov 10, 2022 at 02:09:45PM +0000, David Howells wrote: > Andrew Lunn <andrew@lunn.ch> wrote: > > > > +#ifdef CONFIG_AF_RXRPC_IPV6 > > > return ipv6_icmp_error(sk, skb, err, port, info, payload); > > > +#endif > > > > Can this be if (IS_ENABLED(CONFIG_AF_RXRPC_IPV6) {} rather than > > #ifdef? It gives better build testing. > > Sure. Does it actually make that much of a difference? I guess the > declaration is there even if IPV6 is disabled. And that is the point. Even if this feature is disabled, the type checking will be performed, the number of parameters etc. Somebody who modifies ipv6_icmp_error() is going to find problems with a single compilation, rather than having to use a big collection of random configs. So this is a review comment i often make. Avoid #ifdef if you can, use IS_ENABLED() inside an if statement. Andrew
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c index a178f71e5082..25cdfcf7b415 100644 --- a/net/rxrpc/local_object.c +++ b/net/rxrpc/local_object.c @@ -33,7 +33,9 @@ static void rxrpc_encap_err_rcv(struct sock *sk, struct sk_buff *skb, int err, { if (ip_hdr(skb)->version == IPVERSION) return ip_icmp_error(sk, skb, err, port, info, payload); +#ifdef CONFIG_AF_RXRPC_IPV6 return ipv6_icmp_error(sk, skb, err, port, info, payload); +#endif } /*