[netfilter-cvslog] r3794 - in trunk/patch-o-matic-ng/ULOG: linux/Documentation linux/net/ipv6/netfilter linux-2.6/net/ipv6/netfilter

kaber at netfilter.org kaber at netfilter.org
Tue Mar 15 20:17:59 CET 2005


Author: kaber at netfilter.org
Date: 2005-03-15 20:17:59 +0100 (Tue, 15 Mar 2005)
New Revision: 3794

Modified:
   trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/Kconfig.ladd
   trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/ip6t_ULOG.c
   trunk/patch-o-matic-ng/ULOG/linux/Documentation/Configure.help.ladd
   trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/Config.in.ladd
   trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/ip6t_ULOG.c
Log:
[PATCH]: fixed multiple bugs in ipv6 version of ULOG (Jonas Berlin <xkr47 at outerspace.dyndns.org>)


Modified: trunk/patch-o-matic-ng/ULOG/linux/Documentation/Configure.help.ladd
===================================================================
--- trunk/patch-o-matic-ng/ULOG/linux/Documentation/Configure.help.ladd	2005-03-12 14:43:05 UTC (rev 3793)
+++ trunk/patch-o-matic-ng/ULOG/linux/Documentation/Configure.help.ladd	2005-03-15 19:17:59 UTC (rev 3794)
@@ -6,7 +6,8 @@
   daemon using netlink multicast sockets; unlike the LOG target
   which can only be viewed through syslog.
 
-  This target requires the ipv4 version to be compiled as well.
+  NOTE: This target requires the ipv4 version of ULOG to be compiled as
+        well.
 
   The apropriate userspace logging daemon (ulogd) may be obtained from
   <http://www.gnumonks.org/projects/ulogd/>

Modified: trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/Config.in.ladd
===================================================================
--- trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/Config.in.ladd	2005-03-12 14:43:05 UTC (rev 3793)
+++ trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/Config.in.ladd	2005-03-15 19:17:59 UTC (rev 3794)
@@ -1,4 +1,4 @@
     dep_tristate '    LOG target support' CONFIG_IP6_NF_TARGET_LOG $CONFIG_IP6_NF_FILTER
-    if [ "$CONFIG_IP_NF_TARGET_LOG" != "n" ]; then
-      dep_tristate '    ULOG target support' CONFIG_IP6_NF_TARGET_ULOG $CONFIG_IP6_NF_FILTER $CONFIG_IP_NF_TARGET_LOG
+    if [ "$CONFIG_IP_NF_TARGET_ULOG" != "n" ]; then
+      dep_tristate '    ULOG target support' CONFIG_IP6_NF_TARGET_ULOG $CONFIG_IP6_NF_FILTER $CONFIG_IP_NF_TARGET_ULOG
     fi

Modified: trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/ip6t_ULOG.c
===================================================================
--- trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/ip6t_ULOG.c	2005-03-12 14:43:05 UTC (rev 3793)
+++ trunk/patch-o-matic-ng/ULOG/linux/net/ipv6/netfilter/ip6t_ULOG.c	2005-03-15 19:17:59 UTC (rev 3794)
@@ -26,25 +26,11 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
-#include <linux/spinlock.h>
-#include <linux/socket.h>
-#include <linux/skbuff.h>
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/netlink.h>
-#include <linux/netdevice.h>
-#include <linux/mm.h>
-#include <linux/moduleparam.h>
-#include <linux/netfilter.h>
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
-#include <linux/netfilter_ipv4/lockhelp.h>
-#include <net/sock.h>
-#include <linux/bitops.h>
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jonas Berlin <jberlin at niksula.hut.fi>");
+MODULE_AUTHOR("Jonas Berlin <xkr47 at outerspace.dyndns.org>");
 MODULE_DESCRIPTION("ip6tables userspace logging module");
 
 #if 0
@@ -54,47 +40,24 @@
 #define DEBUGP(format, args...)
 #endif
 
-static unsigned int nflog = 1;
-module_param(nflog, int, 0400);
-MODULE_PARM_DESC(nflog, "register as internal netfilter logging module");
-
 // from ipt_ULOG.c
-void ipt_ulog_packet(unsigned int hooknum,
-		     const struct sk_buff *skb,
-		     const struct net_device *in,
-		     const struct net_device *out,
-		     const struct ipt_ulog_info *loginfo,
-		     const char *prefix);
+unsigned int ipt_ulog_target(struct sk_buff **pskb,
+			     unsigned int hooknum,
+			     const struct net_device *in,
+			     const struct net_device *out,
+			     const void *targinfo, void *userinfo);
 
 static unsigned int ip6t_ulog_target(struct sk_buff **pskb,
+				    unsigned int hooknum,
 				    const struct net_device *in,
 				    const struct net_device *out,
-				    unsigned int hooknum,
 				    const void *targinfo, void *userinfo)
 {
-	struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
+	ipt_ulog_target(pskb, hooknum, in, out, targinfo, userinfo);
 
-	ipt_ulog_packet(hooknum, *pskb, in, out, loginfo, NULL);
- 
  	return IP6T_CONTINUE;
 }
  
-static void ip6t_logfn(unsigned int hooknum,
-		      const struct sk_buff *skb,
-		      const struct net_device *in,
-		      const struct net_device *out,
-		      const char *prefix)
-{
-	struct ipt_ulog_info loginfo = { 
-		.nl_group = ULOG_DEFAULT_NLGROUP,
-		.copy_range = 0,
-		.qthreshold = ULOG_DEFAULT_QTHRESHOLD,
-		.prefix = ""
-	};
-
-	ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
-}
-
 static int ip6t_ulog_checkentry(const char *tablename,
 			       const struct ip6t_entry *e,
 			       void *targinfo,
@@ -123,11 +86,10 @@
 	return 1;
 }
 
-static struct ip6t_target ip6t_ulog_reg = {
-	.name		= "ULOG",
-	.target		= ip6t_ulog_target,
-	.checkentry	= ip6t_ulog_checkentry,
-	.me		= THIS_MODULE,
+
+static struct ip6t_target ip6t_ulog_reg =
+    { {NULL, NULL}, "ULOG", ip6t_ulog_target, ip6t_ulog_checkentry, NULL,
+THIS_MODULE
 };
 
 static int __init init(void)
@@ -137,8 +99,6 @@
 	if (ip6t_register_target(&ip6t_ulog_reg) != 0) {
 		return -EINVAL;
 	}
-	if (nflog)
-		nf_log_register(PF_INET, &ip6t_logfn);
 	
 	return 0;
 }
@@ -147,8 +107,6 @@
 {
 	DEBUGP("ip6t_ULOG: cleanup_module\n");
 
-	if (nflog)
-		nf_log_unregister(PF_INET, &ip6t_logfn);
 	ip6t_unregister_target(&ip6t_ulog_reg);
 }
 

Modified: trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/Kconfig.ladd
===================================================================
--- trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/Kconfig.ladd	2005-03-12 14:43:05 UTC (rev 3793)
+++ trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/Kconfig.ladd	2005-03-15 19:17:59 UTC (rev 3794)
@@ -7,7 +7,8 @@
 	  daemon using netlink multicast sockets; unlike the LOG target
 	  which can only be viewed through syslog.
 
-	  This target requires the ipv4 version to be compiled as well.
+	  NOTE: This target requires the ipv4 version of ULOG to be compiled as
+	        well.
 
 	  The apropriate userspace logging daemon (ulogd) may be obtained from
 	  <http://www.gnumonks.org/projects/ulogd/>

Modified: trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/ip6t_ULOG.c
===================================================================
--- trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/ip6t_ULOG.c	2005-03-12 14:43:05 UTC (rev 3793)
+++ trunk/patch-o-matic-ng/ULOG/linux-2.6/net/ipv6/netfilter/ip6t_ULOG.c	2005-03-15 19:17:59 UTC (rev 3794)
@@ -26,25 +26,11 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
-#include <linux/spinlock.h>
-#include <linux/socket.h>
-#include <linux/skbuff.h>
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/netlink.h>
-#include <linux/netdevice.h>
-#include <linux/mm.h>
-#include <linux/moduleparam.h>
-#include <linux/netfilter.h>
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
-#include <linux/netfilter_ipv4/lockhelp.h>
-#include <net/sock.h>
-#include <linux/bitops.h>
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jonas Berlin <jberlin at niksula.hut.fi>");
+MODULE_AUTHOR("Jonas Berlin <xkr47 at outerspace.dyndns.org>");
 MODULE_DESCRIPTION("ip6tables userspace logging module");
 
 #if 0
@@ -72,7 +58,7 @@
 				    unsigned int hooknum,
 				    const void *targinfo, void *userinfo)
 {
-	struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
+	const struct ipt_ulog_info *loginfo = (const struct ipt_ulog_info *) targinfo;
 
 	ipt_ulog_packet(hooknum, *pskb, in, out, loginfo, NULL);
  
@@ -138,7 +124,7 @@
 		return -EINVAL;
 	}
 	if (nflog)
-		nf_log_register(PF_INET, &ip6t_logfn);
+		nf_log_register(PF_INET6, &ip6t_logfn);
 	
 	return 0;
 }
@@ -148,7 +134,7 @@
 	DEBUGP("ip6t_ULOG: cleanup_module\n");
 
 	if (nflog)
-		nf_log_unregister(PF_INET, &ip6t_logfn);
+		nf_log_unregister(PF_INET6, &ip6t_logfn);
 	ip6t_unregister_target(&ip6t_ulog_reg);
 }
 




More information about the netfilter-cvslog mailing list