netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT
[ Upstream commit 224a876e37 ]
gcc with W=1 and ! CONFIG_NF_NAT
net/netfilter/nf_conntrack_netlink.c:3463:32: error:
‘exp_nat_nla_policy’ defined but not used [-Werror=unused-const-variable=]
3463 | static const struct nla_policy exp_nat_nla_policy[CTA_EXPECT_NAT_MAX+1] = {
| ^~~~~~~~~~~~~~~~~~
net/netfilter/nf_conntrack_netlink.c:2979:33: error:
‘any_addr’ defined but not used [-Werror=unused-const-variable=]
2979 | static const union nf_inet_addr any_addr;
| ^~~~~~~~
These variables use is controlled by CONFIG_NF_NAT, so should their definitions.
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1c2537291e
commit
4987bf0446
1 changed files with 4 additions and 0 deletions
|
|
@ -2968,7 +2968,9 @@ nla_put_failure:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_NF_NAT)
|
||||||
static const union nf_inet_addr any_addr;
|
static const union nf_inet_addr any_addr;
|
||||||
|
#endif
|
||||||
|
|
||||||
static __be32 nf_expect_get_id(const struct nf_conntrack_expect *exp)
|
static __be32 nf_expect_get_id(const struct nf_conntrack_expect *exp)
|
||||||
{
|
{
|
||||||
|
|
@ -3458,10 +3460,12 @@ ctnetlink_change_expect(struct nf_conntrack_expect *x,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_NF_NAT)
|
||||||
static const struct nla_policy exp_nat_nla_policy[CTA_EXPECT_NAT_MAX+1] = {
|
static const struct nla_policy exp_nat_nla_policy[CTA_EXPECT_NAT_MAX+1] = {
|
||||||
[CTA_EXPECT_NAT_DIR] = { .type = NLA_U32 },
|
[CTA_EXPECT_NAT_DIR] = { .type = NLA_U32 },
|
||||||
[CTA_EXPECT_NAT_TUPLE] = { .type = NLA_NESTED },
|
[CTA_EXPECT_NAT_TUPLE] = { .type = NLA_NESTED },
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ctnetlink_parse_expect_nat(const struct nlattr *attr,
|
ctnetlink_parse_expect_nat(const struct nlattr *attr,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue