[NETFILTER]: add some consts, remove some casts
[firefly-linux-kernel-4.4.55.git] / net / netfilter / xt_realm.c
index 5e31a4a835bfd32d5c1dc12a49f61f5eb5573031..44b807d279ada3595ec4327bf247123f6d54e9bd 100644 (file)
@@ -1,6 +1,4 @@
 /* IP tables module for matching the routing realm
- *
- * $Id: ipt_realm.c,v 1.3 2004/03/05 13:25:40 laforge Exp $
  *
  * (C) 2003 by Sampsa Ranta <sampsa@netsonic.fi>
  *
@@ -23,7 +21,7 @@ MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("X_tables realm match");
 MODULE_ALIAS("ipt_realm");
 
-static int
+static bool
 match(const struct sk_buff *skb,
       const struct net_device *in,
       const struct net_device *out,
@@ -31,11 +29,11 @@ match(const struct sk_buff *skb,
       const void *matchinfo,
       int offset,
       unsigned int protoff,
-      int *hotdrop)
+      bool *hotdrop)
 {
        const struct xt_realm_info *info = matchinfo;
-       struct dst_entry *dst = skb->dst;
-    
+       const struct dst_entry *dst = skb->dst;
+
        return (info->id == (dst->tclassid & info->mask)) ^ info->invert;
 }
 
@@ -49,15 +47,15 @@ static struct xt_match realm_match = {
        .me             = THIS_MODULE
 };
 
-static int __init init(void)
+static int __init xt_realm_init(void)
 {
        return xt_register_match(&realm_match);
 }
 
-static void __exit fini(void)
+static void __exit xt_realm_fini(void)
 {
        xt_unregister_match(&realm_match);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(xt_realm_init);
+module_exit(xt_realm_fini);