8 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9 #include <linux/module.h>
11 #include <linux/netdevice.h>
17 #include <linux/netfilter/x_tables.h>
23 static bool rpfilter_addr_unicast(
const struct in6_addr *
addr)
25 int addr_type = ipv6_addr_type(addr);
29 static bool rpfilter_lookup_reverse6(
const struct sk_buff *
skb,
33 struct ipv6hdr *iph = ipv6_hdr(skb);
42 if (rpfilter_addr_unicast(&iph->
daddr)) {
67 if (rt->
rt6i_idev->dev == dev || (flags & XT_RPFILTER_LOOSE))
85 saddrtype = ipv6_addr_type(&iph->
saddr);
89 return rpfilter_lookup_reverse6(skb, par->
in, info->
flags) ^ invert;
95 unsigned int options = ~XT_RPFILTER_OPTION_MASK;
97 if (info->
flags & options) {
98 pr_info(
"unknown options encountered");
104 pr_info(
"match only valid in the \'raw\' "
105 "or \'mangle\' tables, not \'%s\'.\n", par->
table);
115 .checkentry = rpfilter_check,
116 .match = rpfilter_mt,
122 static int __init rpfilter_mt_init(
void)
127 static void __exit rpfilter_mt_exit(
void)