]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/xt_CONNSECMARK.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / net / netfilter / xt_CONNSECMARK.c
index 81c0c58bab4755bb45973f976bfff77ce2b524f6..d8feba9bdb489dfba98f3ab4fb742bbc204004ea 100644 (file)
@@ -33,7 +33,7 @@ MODULE_ALIAS("ip6t_CONNSECMARK");
  * If the packet has a security mark and the connection does not, copy
  * the security mark from the packet to the connection.
  */
-static void secmark_save(struct sk_buff *skb)
+static void secmark_save(const struct sk_buff *skb)
 {
        if (skb->secmark) {
                struct nf_conn *ct;
@@ -61,12 +61,11 @@ static void secmark_restore(struct sk_buff *skb)
        }
 }
 
-static unsigned int target(struct sk_buff **pskb, const struct net_device *in,
+static unsigned int target(struct sk_buff *skb, const struct net_device *in,
                           const struct net_device *out, unsigned int hooknum,
                           const struct xt_target *target,
                           const void *targinfo)
 {
-       struct sk_buff *skb = *pskb;
        const struct xt_connsecmark_target_info *info = targinfo;
 
        switch (info->mode) {
@@ -85,17 +84,12 @@ static unsigned int target(struct sk_buff **pskb, const struct net_device *in,
        return XT_CONTINUE;
 }
 
-static int checkentry(const char *tablename, const void *entry,
-                     const struct xt_target *target, void *targinfo,
-                     unsigned int hook_mask)
+static bool checkentry(const char *tablename, const void *entry,
+                      const struct xt_target *target, void *targinfo,
+                      unsigned int hook_mask)
 {
-       struct xt_connsecmark_target_info *info = targinfo;
+       const struct xt_connsecmark_target_info *info = targinfo;
 
-       if (nf_ct_l3proto_try_module_get(target->family) < 0) {
-               printk(KERN_WARNING "can't load conntrack support for "
-                                   "proto=%d\n", target->family);
-               return 0;
-       }
        switch (info->mode) {
        case CONNSECMARK_SAVE:
        case CONNSECMARK_RESTORE:
@@ -103,10 +97,15 @@ static int checkentry(const char *tablename, const void *entry,
 
        default:
                printk(KERN_INFO PFX "invalid mode: %hu\n", info->mode);
-               return 0;
+               return false;
        }
 
-       return 1;
+       if (nf_ct_l3proto_try_module_get(target->family) < 0) {
+               printk(KERN_WARNING "can't load conntrack support for "
+                                   "proto=%d\n", target->family);
+               return false;
+       }
+       return true;
 }
 
 static void
@@ -115,7 +114,7 @@ destroy(const struct xt_target *target, void *targinfo)
        nf_ct_l3proto_module_put(target->family);
 }
 
-static struct xt_target xt_connsecmark_target[] = {
+static struct xt_target xt_connsecmark_target[] __read_mostly = {
        {
                .name           = "CONNSECMARK",
                .family         = AF_INET,