From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jim Davis <jim.epost@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next <linux-next@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
netfilter-devel <netfilter-devel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: randconfig build error with next-20140911, in net/ipv6/netfilter/nf_nat_masquerade_ipv6.c
Date: Thu, 11 Sep 2014 17:01:56 +0200 [thread overview]
Message-ID: <20140911150156.GA5798@salvia> (raw)
In-Reply-To: <CA+r1ZhgA_3eYymnfBbTcBG+KoOW_k0hAqO-Z-JPemJCgOMsR=A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 907 bytes --]
On Thu, Sep 11, 2014 at 07:41:33AM -0700, Jim Davis wrote:
> Building with the attached random configuration file,
>
> net/ipv6/netfilter/nf_nat_masquerade_ipv6.c: In function
> ‘nf_nat_masquerade_ipv6’:
> net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:41:14: error: ‘struct
> nf_conn_nat’ has no member named ‘masq_index’
> nfct_nat(ct)->masq_index = out->ifindex;
> ^
> net/ipv6/netfilter/nf_nat_masquerade_ipv6.c: In function ‘device_cmp’:
> net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:61:12: error: ‘const
> struct nf_conn_nat’ has no member named ‘masq_index’
> return nat->masq_index == (int)(long)ifindex;
> ^
> net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:62:1: warning: control
> reaches end of non-void function [-Wreturn-type]
> }
> ^
> make[3]: *** [net/ipv6/netfilter/nf_nat_masquerade_ipv6.o] Error 1
Patch attached, thanks for reporting.
[-- Attachment #2: 0001-netfilter-fix-compilation-of-masquerading-without-IP.patch --]
[-- Type: text/x-diff, Size: 2646 bytes --]
>From bc96cd5a3f47e9a6401bc5fb0f7b26145271f6a0 Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu, 11 Sep 2014 16:55:04 +0200
Subject: [PATCH nf-next] netfilter: fix compilation of masquerading without IP_NF_TARGET_MASQUERADE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
CONFIG_NF_NAT_MASQUERADE_IPV6=m
# CONFIG_IP6_NF_TARGET_MASQUERADE is not set
results in:
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c: In function ‘nf_nat_masquerade_ipv6’:
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:41:14: error: ‘struct nf_conn_nat’ has no member named ‘masq_index’
nfct_nat(ct)->masq_index = out->ifindex;
^
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c: In function ‘device_cmp’:
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:61:12: error: ‘const struct nf_conn_nat’ has no member named ‘masq_index’
return nat->masq_index == (int)(long)ifindex;
^
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c:62:1: warning: control
reaches end of non-void function [-Wreturn-type]
}
^
make[3]: *** [net/ipv6/netfilter/nf_nat_masquerade_ipv6.o] Error 1
Fix this by using the new NF_NAT_MASQUERADE_IPV4 and _IPV6 symbols
in include/net/netfilter/nf_nat.h.
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/net/netfilter/nf_nat.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index a71dd33..344b1ab 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -32,10 +32,8 @@ struct nf_conn_nat {
struct hlist_node bysource;
struct nf_conn *ct;
union nf_conntrack_nat_help help;
-#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
- defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) || \
- defined(CONFIG_IP6_NF_TARGET_MASQUERADE) || \
- defined(CONFIG_IP6_NF_TARGET_MASQUERADE_MODULE)
+#if IS_ENABLED(CONFIG_NF_NAT_MASQUERADE_IPV4) || \
+ IS_ENABLED(CONFIG_NF_NAT_MASQUERADE_IPV6)
int masq_index;
#endif
};
@@ -68,8 +66,8 @@ static inline bool nf_nat_oif_changed(unsigned int hooknum,
struct nf_conn_nat *nat,
const struct net_device *out)
{
-#if IS_ENABLED(CONFIG_IP_NF_TARGET_MASQUERADE) || \
- IS_ENABLED(CONFIG_IP6_NF_TARGET_MASQUERADE)
+#if IS_ENABLED(CONFIG_NF_NAT_MASQUERADE_IPV4) || \
+ IS_ENABLED(CONFIG_NF_NAT_MASQUERADE_IPV6)
return nat->masq_index && hooknum == NF_INET_POST_ROUTING &&
CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL &&
nat->masq_index != out->ifindex;
--
1.7.10.4
prev parent reply other threads:[~2014-09-11 15:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 14:41 randconfig build error with next-20140911, in net/ipv6/netfilter/nf_nat_masquerade_ipv6.c Jim Davis
2014-09-11 15:01 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140911150156.GA5798@salvia \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=jim.epost@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).