SOURCES: kernel-desktop-ipt_account.patch - update from kernel-des...

glen glen at pld-linux.org
Wed Apr 9 01:04:10 CEST 2008


Author: glen                         Date: Tue Apr  8 23:04:10 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update from kernel-desktop-ipt_account.patch r1.2

---- Files affected:
SOURCES:
   kernel-desktop-ipt_account.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/kernel-desktop-ipt_account.patch
diff -u SOURCES/kernel-desktop-ipt_account.patch:1.2 SOURCES/kernel-desktop-ipt_account.patch:1.3
--- SOURCES/kernel-desktop-ipt_account.patch:1.2	Thu Aug 23 20:00:54 2007
+++ SOURCES/kernel-desktop-ipt_account.patch	Wed Apr  9 01:04:04 2008
@@ -354,7 +354,7 @@
 +/*
 + * Match function. Here we do accounting stuff.
 + */
-+static int
++static bool
 +match(const struct sk_buff *skb,
 +      const struct net_device *in,
 +      const struct net_device *out,
@@ -364,7 +364,7 @@
 +      const void *matchinfo,
 +      int offset,
 +      unsigned int protoff,
-+      int *hotdrop)
++      bool *hotdrop)
 +{
 +  struct t_ipt_account_info *info = (struct t_ipt_account_info *)matchinfo;
 +  struct t_ipt_account_table *table = info->table;
@@ -372,7 +372,7 @@
 +  /* Get current time. */
 +  struct timespec now = CURRENT_TIME_SEC;
 +  /* Default we assume no match. */
-+  int ret = 0;
++  bool ret = false;
 +    
 +#ifdef DEBUG_IPT_ACCOUNT  
 +  if (debug) printk(KERN_DEBUG "ipt_account [match]: name = %s\n", table->name);
@@ -415,7 +415,7 @@
 +    }
 +    write_unlock_bh(&table->stats_lock);
 +    /* Yes, it's a match. */
-+    ret = 1;
++    ret = true;
 +  }
 +  
 +  /* Do the same thing with destination ip address. */
@@ -449,7 +449,7 @@
 +      }
 +    }
 +    write_unlock_bh(&table->stats_lock);
-+    ret = 1;
++    ret = true;
 +  }
 +  
 +  return ret;
@@ -458,7 +458,7 @@
 +/*
 + * Checkentry function.
 + */
-+static int
++static bool
 +checkentry(const char *tablename,
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)    
 +     const void *ip,
@@ -485,7 +485,7 @@
 +#ifdef DEBUG_IPT_ACCOUNT  
 +    if (debug) printk(KERN_DEBUG "ipt_account [checkentry]: matchsize %u != %u\n", matchsize, IPT_ALIGN(sizeof(struct t_ipt_account_info)));
 +#endif    
-+    return 0;
++    return false;
 +  }
 +#endif
 +
@@ -494,15 +494,15 @@
 +   */
 +  if (info->netmask < ((~0L << (32 - netmask)) & 0xffffffff)) {
 +    printk(KERN_ERR "ipt_account[checkentry]: too big netmask (increase module 'netmask' parameter).\n");
-+    return 0;
++    return false;
 +  }
 +  if ((info->network & info->netmask) != info->network) {
 +    printk(KERN_ERR "ipt_account[checkentry]: wrong network/netmask.\n");
-+    return 0;
++    return false;
 +  }
 +  if (info->name[0] == '\0') {
 +    printk(KERN_ERR "ipt_account[checkentry]: wrong table name.\n");
-+    return 0;
++    return false;
 +  }
 +
 +  /*
@@ -516,10 +516,10 @@
 +      if (info->table != table) {
 +        printk(KERN_ERR "ipt_account[checkentry]: reloaded rule has invalid table pointer.\n");
 +        up(&ipt_account_mutex);
-+        return 0;
++        return false;
 +      }
 +      up(&ipt_account_mutex);
-+      return 1;
++      return true;
 +    } else {
 +#ifdef DEBUG_IPT_ACCOUNT  
 +      if (debug) printk(KERN_DEBUG "ipt_account [checkentry]: table found, checking.\n");
@@ -535,7 +535,7 @@
 +         */
 +        ipt_account_table_put(table);
 +        up(&ipt_account_mutex);
-+        return 0;
++        return false;
 +      }
 +#ifdef DEBUG_IPT_ACCOUNT  
 +      if (debug) printk(KERN_DEBUG "ipt_account [checkentry]: table found, reusing.\n");
@@ -555,11 +555,11 @@
 +    info->table = table = ipt_account_table_init(info);
 +    if (!table) {
 +      up(&ipt_account_mutex);
-+      return 0;
++      return false;
 +    }
 +  }
 +  up(&ipt_account_mutex);
-+  return 1;
++  return true;
 +}
 +
 +/*
@@ -938,9 +938,9 @@
 +  }
 +
 +  /* Create /proc/net/ipt_account/ entry. */
-+  ipt_account_procdir = proc_mkdir("ipt_account", proc_net);
++  ipt_account_procdir = proc_mkdir("ipt_account", init_net.proc_net);
 +  if (!ipt_account_procdir) {   
-+    printk(KERN_ERR "ipt_account [__init]: ipt_account_procdir = proc_mkdir(\"ipt_account\", proc_net) failed.\n");
++    printk(KERN_ERR "ipt_account [__init]: ipt_account_procdir = proc_mkdir(\"ipt_account\", init_net.proc_net) failed.\n");
 +    ret = -ENOMEM;
 +    goto cleanup_match;
 +  }
@@ -1004,16 +1004,10 @@
 +#endif /* _IPT_ACCOUNT_H */
 +
 diff -uNrp linux/net/ipv4/netfilter/Makefile.a linux/net/ipv4/netfilter/Makefile.b
---- linux/net/ipv4/netfilter/Makefile	1970-01-01 01:00:00.000000000 +0100
+--- linux/net/ipv4/netfilter/Makefile	1971-01-01 01:00:00.000000000 +0100
 +++ linux/net/ipv4/netfilter/Makefile	2007-08-15 13:23:25.375304000 +0200
-@@ -52,6 +52,7 @@
- obj-$(CONFIG_IP_NF_MATCH_CONNLIMIT) += ipt_connlimit.o
- obj-$(CONFIG_IP_NF_MATCH_IPP2P) += ipt_ipp2p.o
- obj-$(CONFIG_IP_NF_MATCH_TIME) += ipt_time.o
+@@ -0,0 +0,1 @@
 +obj-$(CONFIG_IP_NF_MATCH_ACCOUNT) += ipt_account.o
- 
- obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o
- obj-$(CONFIG_IP_NF_MATCH_GEOIP) += ipt_geoip.o
 diff -Nur linux/net/ipv4/netfilter/Kconfig linux/net/ipv4/netfilter/Kconfig
 --- linux/net/ipv4/netfilter/Kconfig	2006-05-02 23:38:44.000000000 +0200
 +++ linux/net/ipv4/netfilter/Kconfig	2006-05-04 11:23:02.000000000 +0200
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-desktop-ipt_account.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list