提交 412662d2 编写于 作者: S Stephen Rothwell 提交者: Pablo Neira Ayuso

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: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 7c7c7f01
...@@ -445,7 +445,6 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, ...@@ -445,7 +445,6 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
{ {
__be16 _ports[2], *ports; __be16 _ports[2], *ports;
u8 nexthdr; u8 nexthdr;
__be16 frag_off;
int poff; int poff;
memset(dst, 0, sizeof(*dst)); memset(dst, 0, sizeof(*dst));
...@@ -466,6 +465,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, ...@@ -466,6 +465,9 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
break; break;
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
case NFPROTO_IPV6: case NFPROTO_IPV6:
{
__be16 frag_off;
if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) { if (hinfo->cfg.mode & XT_HASHLIMIT_HASH_DIP) {
memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr, memcpy(&dst->ip6.dst, &ipv6_hdr(skb)->daddr,
sizeof(dst->ip6.dst)); sizeof(dst->ip6.dst));
...@@ -485,6 +487,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, ...@@ -485,6 +487,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo,
if ((int)protoff < 0) if ((int)protoff < 0)
return -1; return -1;
break; break;
}
#endif #endif
default: default:
BUG(); BUG();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册