Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3303845pxf; Mon, 15 Mar 2021 06:43:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlMesNXQRI5ZWCEKjUBWnEovaco7xxfpzHxWs9rN20xvCLdIpFlsHMX5ClVGtT96s2tMje X-Received: by 2002:a17:906:7d82:: with SMTP id v2mr12939074ejo.524.1615815810444; Mon, 15 Mar 2021 06:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615815810; cv=none; d=google.com; s=arc-20160816; b=06WcJGgfdW4F5HikTGDa/t1q5jfbSzDrdPeSWROdAzAsb5e+h/jSrAPDUQL4iXVNwM vmedfdSD4BfIkMn0hmcD05cGjZy6tvHU8S5dEhjph8Te6Of/7Pu2VRJenT+UZm9CDheS /wFqNXz3j0gYd74zok17ulx/QCmwhIwAVY7DFfwa5Ny7sW4544uOcmEb7wkhw29Ujhy7 +R5Paw2ZXJnBS3GwH8pw2pNwJdet4O3Z62lGIQwktqEIXozXGGjGv9mW6nM6/a4pI70I pGjcv/l9JWrrL0f113/vu2QVJovd2HBsxGJaWCr44FMvmkWC0swZpZS1nNug5WoPCv22 4/xw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HcbP0eh7sT6aYdhihurrqxMVYQRkKRMHymQQjQvK67E=; b=ojYAzzfmjgjMFsgrZiUo9sl4mX/wvgMRcmkvYne2xyjZXDgtmcmANTg/PypFnxJi5i vjW2oTAzKKqhXYeJKZ5fHdcQMuNUUOmB8k+RB72D7lgFIOX/dpTMEoMKXPrc6+aLmti4 DgSSWX+4callcZ16f4vC4WMr7x+Hb09cpW3pWzZwHiE8j8oVqlpLKkONYJOyvfjSq4lw fBWWBBb2ijNOqpEmiakuiO/+wV+KxucBcsENg5fc4e8yqlO1SprBbHrCtNIaQtIRDAcI lBmSMcFK3QqEGtTOwzyrSdCVU2Y+qt9zqGbj23x18TMY0H8+OT8flalNn5jHZGpFZZs3 giAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=K48Yk+Pv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si11573057edc.316.2021.03.15.06.43.07; Mon, 15 Mar 2021 06:43:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=K48Yk+Pv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbhCONlj (ORCPT + 99 others); Mon, 15 Mar 2021 09:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbhCONlO (ORCPT ); Mon, 15 Mar 2021 09:41:14 -0400 X-Greylist: delayed 598 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 15 Mar 2021 06:41:14 PDT Received: from mxwww.masterlogin.de (mxwww.masterlogin.de [IPv6:2a03:2900:1:1::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C62C06174A; Mon, 15 Mar 2021 06:41:14 -0700 (PDT) Received: from mxout2.routing.net (unknown [192.168.10.82]) by backup.mxwww.masterlogin.de (Postfix) with ESMTPS id D2C212C50A; Mon, 15 Mar 2021 13:21:18 +0000 (UTC) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout2.routing.net (Postfix) with ESMTP id E408E5FAA8; Mon, 15 Mar 2021 13:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1615814471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HcbP0eh7sT6aYdhihurrqxMVYQRkKRMHymQQjQvK67E=; b=K48Yk+PvuI2+pAWPe8NlZjcZLTWVP4BMQR59RtwlLyTuHmmv/DrMTtJ3MQ4cf4HbpEVqXm oKNnfKAD599uvZU/+8kW7Fb+sHnVWgpJpgApl/tl3/HtjVR9J0LNXyhImPIZYqAvD1lAGD chMG0YitLQi+oVxzv7PVm4CM07aZbLc= Received: from localhost.localdomain (fttx-pool-217.61.149.205.bambit.de [217.61.149.205]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 3E95610038A; Mon, 15 Mar 2021 13:21:10 +0000 (UTC) From: Frank Wunderlich To: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Frank Wunderlich Subject: [PATCH] net: wireguard: fix error with icmp{,v6}_ndo_send in 5.4 Date: Mon, 15 Mar 2021 14:21:03 +0100 Message-Id: <20210315132103.129386-1-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: d4bbf83d-3042-487a-8ef8-1bd95eef3965 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frank Wunderlich commit 2019554f9656 introduces implementation of icmp{,v6}_ndo_send in include/linux/icmp{,v6}.h in case of NF_NAT is enabled. Now these functions are defined twice in wireguard. Fix this by hiding code if NF_NAT is set (reverse condition as in icmp*.h) ././net/wireguard/compat/compat.h:959:20: error: static declaration of 'icmp_ndo_send' follows non-static declaration 959 | static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info) ./include/net/icmp.h:47:6: note: previous declaration of 'icmp_ndo_send' was here 47 | void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info); ././net/wireguard/compat/compat.h:988:20: error: static declaration of 'icmpv6_ndo_send' follows non-static declaration 988 | static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info) ./include/linux/icmpv6.h:56:6: note: previous declaration of 'icmpv6_ndo_send' was here 56 | void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info); Fixes: 2019554f9656 ("icmp: introduce helper for nat'd source address in network device context") Signed-off-by: Frank Wunderlich --- net/wireguard/compat/compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireguard/compat/compat.h b/net/wireguard/compat/compat.h index 42f7beecaa5c..7cdb0b253c60 100644 --- a/net/wireguard/compat/compat.h +++ b/net/wireguard/compat/compat.h @@ -956,6 +956,7 @@ static inline int skb_ensure_writable(struct sk_buff *skb, int write_len) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) #include #endif +#if !IS_ENABLED(CONFIG_NF_NAT) static inline void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info) { struct sk_buff *cloned_skb = NULL; @@ -1014,6 +1015,7 @@ static inline void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u out: consume_skb(cloned_skb); } +#endif #else #define icmp_ndo_send icmp_send #define icmpv6_ndo_send icmpv6_send -- 2.25.1