netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next] netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES
@ 2016-09-11 14:05 Liping Zhang
  2016-09-11 14:05 ` [PATCH nf-next] netfilter: nft_queue: add _SREG_FROM and _SRGE_TO to select the queue numbers Liping Zhang
  2016-09-12 17:50 ` [PATCH nf-next] netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES Pablo Neira Ayuso
  0 siblings, 2 replies; 16+ messages in thread
From: Liping Zhang @ 2016-09-11 14:05 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Liping Zhang

From: Liping Zhang <liping.zhang@spreadtrum.com>

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 <liping.zhang@spreadtrum.com>
---
 include/net/netfilter/nf_queue.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index 0dbce55..cc8a11f 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -54,7 +54,6 @@ static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval)
 			(__force u32)iph->saddr, iph->protocol, jhash_initval);
 }
 
-#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
 static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
 {
 	const struct ipv6hdr *ip6h = ipv6_hdr(skb);
@@ -77,7 +76,6 @@ static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
 
 	return jhash_3words(a, b, c, jhash_initval);
 }
-#endif
 
 static inline u32
 nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
@@ -85,10 +83,8 @@ nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
 {
 	if (family == NFPROTO_IPV4)
 		queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32;
-#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
 	else if (family == NFPROTO_IPV6)
 		queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32;
-#endif
 
 	return queue;
 }
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-09-13 12:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-11 14:05 [PATCH nf-next] netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES Liping Zhang
2016-09-11 14:05 ` [PATCH nf-next] netfilter: nft_queue: add _SREG_FROM and _SRGE_TO to select the queue numbers Liping Zhang
2016-09-11 21:12   ` Florian Westphal
2016-09-12  2:19     ` Liping Zhang
2016-09-12 10:53     ` Laura Garcia
2016-09-12 12:28       ` Florian Westphal
2016-09-12 12:39         ` Pablo Neira Ayuso
2016-09-12 12:09     ` Pablo Neira Ayuso
2016-09-12 12:22       ` Florian Westphal
2016-09-12 12:32         ` Pablo Neira Ayuso
2016-09-12 13:18           ` Florian Westphal
2016-09-13  9:19   ` Pablo Neira Ayuso
2016-09-13 12:19     ` Liping Zhang
2016-09-12 17:50 ` [PATCH nf-next] netfilter: nf_queue: get rid of dependency on IP6_NF_IPTABLES Pablo Neira Ayuso
2016-09-13  5:45   ` Liping Zhang
2016-09-13  9:10     ` Pablo Neira Ayuso

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).