]> Pileus Git - ~andy/linux/blobdiff - net/ipv6/netfilter/ip6t_rt.c
Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32
[~andy/linux] / net / ipv6 / netfilter / ip6t_rt.c
index 4c6b55bb225bfea4f0e3569201cd706fe2e68592..81ab00d8c182909764449ff369480592b849f534 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm/byteorder.h>
 
+#include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_ipv6/ip6t_rt.h>
 
@@ -58,9 +59,14 @@ match(const struct sk_buff *skb,
        unsigned int hdrlen = 0;
        unsigned int ret = 0;
        struct in6_addr *ap, _addr;
+       int err;
 
-       if (ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL) < 0)
+       err = ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL);
+       if (err < 0) {
+               if (err != -ENOENT)
+                       *hotdrop = 1;
                return 0;
+       }
 
        rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route);
        if (rh == NULL) {
@@ -197,7 +203,6 @@ checkentry(const char *tablename,
           const void *entry,
           const struct xt_match *match,
           void *matchinfo,
-          unsigned int matchinfosize,
           unsigned int hook_mask)
 {
        const struct ip6t_rt *rtinfo = matchinfo;
@@ -217,23 +222,24 @@ checkentry(const char *tablename,
        return 1;
 }
 
-static struct ip6t_match rt_match = {
+static struct xt_match rt_match = {
        .name           = "rt",
+       .family         = AF_INET6,
        .match          = match,
        .matchsize      = sizeof(struct ip6t_rt),
        .checkentry     = checkentry,
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ip6t_rt_init(void)
 {
-       return ip6t_register_match(&rt_match);
+       return xt_register_match(&rt_match);
 }
 
-static void __exit cleanup(void)
+static void __exit ip6t_rt_fini(void)
 {
-       ip6t_unregister_match(&rt_match);
+       xt_unregister_match(&rt_match);
 }
 
-module_init(init);
-module_exit(cleanup);
+module_init(ip6t_rt_init);
+module_exit(ip6t_rt_fini);