9 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10 #include <linux/module.h>
12 #include <linux/ipv6.h>
13 #include <linux/types.h>
17 #include <asm/byteorder.h>
19 #include <linux/netfilter/x_tables.h>
20 #include <linux/netfilter_ipv6/ip6_tables.h>
32 pr_debug(
"segsleft_match:%c 0x%x <= 0x%x <= 0x%x\n",
33 invert ?
'!' :
' ', min,
id, max);
34 r = (
id >= min &&
id <=
max) ^ invert;
35 pr_debug(
" result %s\n", r ?
"PASS" :
"FAILED");
59 rh = skb_header_pointer(skb, ptr,
sizeof(_route), &_route);
66 if (skb->
len - ptr < hdrlen) {
87 ((rtinfo->
hdrlen == hdrlen) ^
91 ((
const struct rt0_hdr *)rh)->reserved,
93 (((
const struct rt0_hdr *)rh)->reserved)));
109 rp = skb_header_pointer(skb,
123 if (rtinfo->
addrnr > (
unsigned int)((hdrlen - 8) / 16)) {
124 pr_debug(
"There isn't enough space\n");
131 temp < (
unsigned int)((hdrlen - 8) / 16);
133 ap = skb_header_pointer(skb,
136 + temp *
sizeof(_addr),
142 if (ipv6_addr_equal(ap, &rtinfo->
addrs[i])) {
143 pr_debug(
"i=%d temp=%d;\n", i, temp);
157 if (rtinfo->
addrnr > (
unsigned int)((hdrlen - 8) / 16)) {
158 pr_debug(
"There isn't enough space\n");
162 for (temp = 0; temp < rtinfo->
addrnr; temp++) {
163 ap = skb_header_pointer(skb,
166 + temp *
sizeof(_addr),
171 if (!ipv6_addr_equal(ap, &rtinfo->
addrs[temp]))
175 if (temp == rtinfo->
addrnr &&
176 temp == (
unsigned int)((hdrlen - 8) / 16))
198 pr_debug(
"`--rt-type 0' required before `--rt-0-*'");
209 .matchsize =
sizeof(
struct ip6t_rt),
210 .checkentry = rt_mt6_check,
214 static int __init rt_mt6_init(
void)
219 static void __exit rt_mt6_exit(
void)