Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: move inline nf_ip6_ext_hdr() function to a more appropriate header.

There is an inline function in ip6_tables.h which is not specific to
ip6tables and is used elswhere in netfilter. Move it into
netfilter_ipv6.h and update the callers.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Jeremy Sowden and committed by
Pablo Neira Ayuso
44dde236 8bf3cbe3

+16 -16
+12
include/linux/netfilter_ipv6.h
··· 10 10 #include <uapi/linux/netfilter_ipv6.h> 11 11 #include <net/tcp.h> 12 12 13 + /* Check for an extension */ 14 + static inline int 15 + nf_ip6_ext_hdr(u8 nexthdr) 16 + { return (nexthdr == IPPROTO_HOPOPTS) || 17 + (nexthdr == IPPROTO_ROUTING) || 18 + (nexthdr == IPPROTO_FRAGMENT) || 19 + (nexthdr == IPPROTO_ESP) || 20 + (nexthdr == IPPROTO_AH) || 21 + (nexthdr == IPPROTO_NONE) || 22 + (nexthdr == IPPROTO_DSTOPTS); 23 + } 24 + 13 25 /* Extra routing may needed on local out, as the QUEUE target never returns 14 26 * control to the table. 15 27 */
-12
include/linux/netfilter_ipv6/ip6_tables.h
··· 36 36 struct xt_table *table); 37 37 #endif 38 38 39 - /* Check for an extension */ 40 - static inline int 41 - ip6t_ext_hdr(u8 nexthdr) 42 - { return (nexthdr == IPPROTO_HOPOPTS) || 43 - (nexthdr == IPPROTO_ROUTING) || 44 - (nexthdr == IPPROTO_FRAGMENT) || 45 - (nexthdr == IPPROTO_ESP) || 46 - (nexthdr == IPPROTO_AH) || 47 - (nexthdr == IPPROTO_NONE) || 48 - (nexthdr == IPPROTO_DSTOPTS); 49 - } 50 - 51 39 #ifdef CONFIG_COMPAT 52 40 #include <net/compat.h> 53 41
+2 -2
net/ipv6/netfilter/ip6t_ipv6header.c
··· 16 16 #include <net/ipv6.h> 17 17 18 18 #include <linux/netfilter/x_tables.h> 19 - #include <linux/netfilter_ipv6/ip6_tables.h> 19 + #include <linux/netfilter_ipv6.h> 20 20 #include <linux/netfilter_ipv6/ip6t_ipv6header.h> 21 21 22 22 MODULE_LICENSE("GPL"); ··· 42 42 len = skb->len - ptr; 43 43 temp = 0; 44 44 45 - while (ip6t_ext_hdr(nexthdr)) { 45 + while (nf_ip6_ext_hdr(nexthdr)) { 46 46 const struct ipv6_opt_hdr *hp; 47 47 struct ipv6_opt_hdr _hdr; 48 48 int hdrlen;
+2 -2
net/ipv6/netfilter/nf_log_ipv6.c
··· 18 18 #include <net/route.h> 19 19 20 20 #include <linux/netfilter.h> 21 - #include <linux/netfilter_ipv6/ip6_tables.h> 21 + #include <linux/netfilter_ipv6.h> 22 22 #include <linux/netfilter/xt_LOG.h> 23 23 #include <net/netfilter/nf_log.h> 24 24 ··· 70 70 fragment = 0; 71 71 ptr = ip6hoff + sizeof(struct ipv6hdr); 72 72 currenthdr = ih->nexthdr; 73 - while (currenthdr != NEXTHDR_NONE && ip6t_ext_hdr(currenthdr)) { 73 + while (currenthdr != NEXTHDR_NONE && nf_ip6_ext_hdr(currenthdr)) { 74 74 struct ipv6_opt_hdr _hdr; 75 75 const struct ipv6_opt_hdr *hp; 76 76