Commit 44dde236 authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Pablo Neira Ayuso

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: default avatarJeremy Sowden <jeremy@azazel.net>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 8bf3cbe3
...@@ -10,6 +10,18 @@ ...@@ -10,6 +10,18 @@
#include <uapi/linux/netfilter_ipv6.h> #include <uapi/linux/netfilter_ipv6.h>
#include <net/tcp.h> #include <net/tcp.h>
/* Check for an extension */
static inline int
nf_ip6_ext_hdr(u8 nexthdr)
{ return (nexthdr == IPPROTO_HOPOPTS) ||
(nexthdr == IPPROTO_ROUTING) ||
(nexthdr == IPPROTO_FRAGMENT) ||
(nexthdr == IPPROTO_ESP) ||
(nexthdr == IPPROTO_AH) ||
(nexthdr == IPPROTO_NONE) ||
(nexthdr == IPPROTO_DSTOPTS);
}
/* Extra routing may needed on local out, as the QUEUE target never returns /* Extra routing may needed on local out, as the QUEUE target never returns
* control to the table. * control to the table.
*/ */
......
...@@ -36,18 +36,6 @@ extern unsigned int ip6t_do_table(struct sk_buff *skb, ...@@ -36,18 +36,6 @@ extern unsigned int ip6t_do_table(struct sk_buff *skb,
struct xt_table *table); struct xt_table *table);
#endif #endif
/* Check for an extension */
static inline int
ip6t_ext_hdr(u8 nexthdr)
{ return (nexthdr == IPPROTO_HOPOPTS) ||
(nexthdr == IPPROTO_ROUTING) ||
(nexthdr == IPPROTO_FRAGMENT) ||
(nexthdr == IPPROTO_ESP) ||
(nexthdr == IPPROTO_AH) ||
(nexthdr == IPPROTO_NONE) ||
(nexthdr == IPPROTO_DSTOPTS);
}
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
#include <net/compat.h> #include <net/compat.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <net/ipv6.h> #include <net/ipv6.h>
#include <linux/netfilter/x_tables.h> #include <linux/netfilter/x_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6.h>
#include <linux/netfilter_ipv6/ip6t_ipv6header.h> #include <linux/netfilter_ipv6/ip6t_ipv6header.h>
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -42,7 +42,7 @@ ipv6header_mt6(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -42,7 +42,7 @@ ipv6header_mt6(const struct sk_buff *skb, struct xt_action_param *par)
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ip6t_ext_hdr(nexthdr)) { while (nf_ip6_ext_hdr(nexthdr)) {
const struct ipv6_opt_hdr *hp; const struct ipv6_opt_hdr *hp;
struct ipv6_opt_hdr _hdr; struct ipv6_opt_hdr _hdr;
int hdrlen; int hdrlen;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <net/route.h> #include <net/route.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/netfilter_ipv6/ip6_tables.h> #include <linux/netfilter_ipv6.h>
#include <linux/netfilter/xt_LOG.h> #include <linux/netfilter/xt_LOG.h>
#include <net/netfilter/nf_log.h> #include <net/netfilter/nf_log.h>
...@@ -70,7 +70,7 @@ static void dump_ipv6_packet(struct net *net, struct nf_log_buf *m, ...@@ -70,7 +70,7 @@ static void dump_ipv6_packet(struct net *net, struct nf_log_buf *m,
fragment = 0; fragment = 0;
ptr = ip6hoff + sizeof(struct ipv6hdr); ptr = ip6hoff + sizeof(struct ipv6hdr);
currenthdr = ih->nexthdr; currenthdr = ih->nexthdr;
while (currenthdr != NEXTHDR_NONE && ip6t_ext_hdr(currenthdr)) { while (currenthdr != NEXTHDR_NONE && nf_ip6_ext_hdr(currenthdr)) {
struct ipv6_opt_hdr _hdr; struct ipv6_opt_hdr _hdr;
const struct ipv6_opt_hdr *hp; const struct ipv6_opt_hdr *hp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment