Skip to content

Commit 6bd1430

Browse files
Liping Zhangummakynes
authored andcommitted
netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES
hash_v6 is used by both nftables and ip6tables, so depend on IP6_NF_IPTABLES is not properly. Actually, it only parses ipv6hdr and computes a hash value, so even if IPV6 is disabled, there's no side effect too, remove it. Signed-off-by: Liping Zhang <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 23d0750 commit 6bd1430

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

include/net/netfilter/nf_queue.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval)
5454
(__force u32)iph->saddr, iph->protocol, jhash_initval);
5555
}
5656

57-
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
5857
static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
5958
{
6059
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
@@ -77,18 +76,15 @@ static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
7776

7877
return jhash_3words(a, b, c, jhash_initval);
7978
}
80-
#endif
8179

8280
static inline u32
8381
nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
8482
u32 jhash_initval)
8583
{
8684
if (family == NFPROTO_IPV4)
8785
queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32;
88-
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
8986
else if (family == NFPROTO_IPV6)
9087
queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32;
91-
#endif
9288

9389
return queue;
9490
}

0 commit comments

Comments
 (0)