Commit 486874ac authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

[NF/IPV6]: Remove all ipv6_ext_hdrs from ip6tables.

parent d21c8bd3
...@@ -449,6 +449,9 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb, ...@@ -449,6 +449,9 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb,
struct ip6t_table *table, struct ip6t_table *table,
void *userdata); void *userdata);
/* Check for an extension */
extern int ip6t_ext_hdr(u8 nexthdr);
#define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1)) #define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1))
#endif /*__KERNEL__*/ #endif /*__KERNEL__*/
......
...@@ -26,17 +26,6 @@ struct ahhdr { ...@@ -26,17 +26,6 @@ struct ahhdr {
__u32 spi; __u32 spi;
}; };
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* Returns 1 if the spi is matched by the range, 0 otherwise */ /* Returns 1 if the spi is matched by the range, 0 otherwise */
static inline int static inline int
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, int invert) spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, int invert)
...@@ -79,7 +68,7 @@ match(const struct sk_buff *skb, ...@@ -79,7 +68,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
DEBUGP("ipv6_ah header iteration \n"); DEBUGP("ipv6_ah header iteration \n");
......
...@@ -29,17 +29,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); ...@@ -29,17 +29,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
#define DEBUGP(format, args...) #define DEBUGP(format, args...)
#endif #endif
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* /*
* (Type & 0xC0) >> 6 * (Type & 0xC0) >> 6
* 0 -> ignorable * 0 -> ignorable
...@@ -84,7 +73,7 @@ match(const struct sk_buff *skb, ...@@ -84,7 +73,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
DEBUGP("ipv6_opts header iteration \n"); DEBUGP("ipv6_opts header iteration \n");
......
...@@ -23,17 +23,6 @@ struct esphdr { ...@@ -23,17 +23,6 @@ struct esphdr {
__u32 spi; __u32 spi;
}; };
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* Returns 1 if the spi is matched by the range, 0 otherwise */ /* Returns 1 if the spi is matched by the range, 0 otherwise */
static inline int static inline int
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, int invert) spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, int invert)
...@@ -74,7 +63,7 @@ match(const struct sk_buff *skb, ...@@ -74,7 +63,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
int hdrlen; int hdrlen;
......
...@@ -44,17 +44,6 @@ struct fraghdr { ...@@ -44,17 +44,6 @@ struct fraghdr {
__u32 id; __u32 id;
}; };
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* Returns 1 if the id is matched by the range, 0 otherwise */ /* Returns 1 if the id is matched by the range, 0 otherwise */
static inline int static inline int
id_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert) id_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert)
...@@ -93,7 +82,7 @@ match(const struct sk_buff *skb, ...@@ -93,7 +82,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
DEBUGP("ipv6_frag header iteration \n"); DEBUGP("ipv6_frag header iteration \n");
......
...@@ -29,17 +29,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); ...@@ -29,17 +29,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
#define DEBUGP(format, args...) #define DEBUGP(format, args...)
#endif #endif
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* /*
* (Type & 0xC0) >> 6 * (Type & 0xC0) >> 6
* 0 -> ignorable * 0 -> ignorable
...@@ -84,7 +73,7 @@ match(const struct sk_buff *skb, ...@@ -84,7 +73,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
DEBUGP("ipv6_opts header iteration \n"); DEBUGP("ipv6_opts header iteration \n");
......
...@@ -24,17 +24,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); ...@@ -24,17 +24,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
#define DEBUGP(format, args...) #define DEBUGP(format, args...)
#endif #endif
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
static int static int
ipv6header_match(const struct sk_buff *skb, ipv6header_match(const struct sk_buff *skb,
const struct net_device *in, const struct net_device *in,
...@@ -95,7 +84,7 @@ ipv6header_match(const struct sk_buff *skb, ...@@ -95,7 +84,7 @@ ipv6header_match(const struct sk_buff *skb,
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
int hdrlen; int hdrlen;
......
...@@ -21,17 +21,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>"); ...@@ -21,17 +21,6 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
#define DEBUGP(format, args...) #define DEBUGP(format, args...)
#endif #endif
int ipv6_ext_hdr(u8 nexthdr)
{
return ( (nexthdr == NEXTHDR_HOP) ||
(nexthdr == NEXTHDR_ROUTING) ||
(nexthdr == NEXTHDR_FRAGMENT) ||
(nexthdr == NEXTHDR_AUTH) ||
(nexthdr == NEXTHDR_ESP) ||
(nexthdr == NEXTHDR_NONE) ||
(nexthdr == NEXTHDR_DEST) );
}
/* Returns 1 if the id is matched by the range, 0 otherwise */ /* Returns 1 if the id is matched by the range, 0 otherwise */
static inline int static inline int
segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert) segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert)
...@@ -71,7 +60,7 @@ match(const struct sk_buff *skb, ...@@ -71,7 +60,7 @@ match(const struct sk_buff *skb,
len = skb->len - ptr; len = skb->len - ptr;
temp = 0; temp = 0;
while (ipv6_ext_hdr(nexthdr)) { while (ip6t_ext_hdr(nexthdr)) {
struct ipv6_opt_hdr *hdr; struct ipv6_opt_hdr *hdr;
DEBUGP("ipv6_rt header iteration \n"); DEBUGP("ipv6_rt header iteration \n");
......
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