summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2012-01-11 11:52:17 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-01-16 13:40:54 +0100
commit412662d204eca981458156fd64d9d5f3b533d7b6 (patch)
treea05bc418b5d943ba4c8d33cc3d8fe24c11d0a67d /net/netfilter
parent7c7c7f01cc5e3e423120a4848a73dd5e4586f2f9 (diff)
downloadlwn-412662d204eca981458156fd64d9d5f3b533d7b6.tar.gz
lwn-412662d204eca981458156fd64d9d5f3b533d7b6.zip
netfilter: xt_hashlimit: fix unused variable warning if IPv6 disabled
Fixes this warning when CONFIG_IP6_NF_IPTABLES is not enabled: net/netfilter/xt_hashlimit.c: In function ‘hashlimit_init_dst’: net/netfilter/xt_hashlimit.c:448:9: warning: unused variable ‘frag_off’ [-Wunused-variable] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/xt_hashlimit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 8e4992101875..d95f9c963cde 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -445,7 +445,6 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
{
__be16 _ports[2], *ports;
u8 nexthdr;
- __be16 frag_off;
int poff;
memset(dst, 0, sizeof(*dst));
@@ -466,6 +465,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
break;
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
case NFPROTO_IPV6:
+ {
+ __be16 frag_off;
+
if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) {
memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr,
sizeof(dst->ip6.dst));
@@ -485,6 +487,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
if ((int)protoff < 0)
return -1;
break;
+ }
#endif
default:
BUG();