[netfilter-cvslog] r6765 - trunk/iptables/extensions

kaber at netfilter.org kaber at netfilter.org
Tue Mar 6 03:00:33 CET 2007


Author: kaber at netfilter.org
Date: 2007-03-06 03:00:32 +0100 (Tue, 06 Mar 2007)
New Revision: 6765

Modified:
   trunk/iptables/extensions/libip6t_NFLOG.c
   trunk/iptables/extensions/libipt_NFLOG.c
Log:
Fix cut and paste error breaking use of groups != 0


Modified: trunk/iptables/extensions/libip6t_NFLOG.c
===================================================================
--- trunk/iptables/extensions/libip6t_NFLOG.c	2007-02-27 20:30:46 UTC (rev 6764)
+++ trunk/iptables/extensions/libip6t_NFLOG.c	2007-03-06 02:00:32 UTC (rev 6765)
@@ -35,7 +35,7 @@
 {
 	struct xt_nflog_info *info = (struct xt_nflog_info *)t->data;
 
-	info->group	= XT_NFLOG_DEFAULT_GROUP;
+	info->group	= 0;
 	info->threshold	= XT_NFLOG_DEFAULT_THRESHOLD;
 }
 
@@ -56,10 +56,10 @@
 				   "Unexpected `!' after --nflog-group");
 
 		n = atoi(optarg);
-		if (n < 1 || n > 32)
+		if (n < 0)
 			exit_error(PARAMETER_PROBLEM,
-				   "--nflog-group has to be between 1 and 32");
-		info->group = 1 << (n - 1);
+				   "--nflog-group can not be negative");
+		info->group = n;
 		break;
 	case NFLOG_PREFIX:
 		if (*flags & NFLOG_PREFIX)
@@ -118,8 +118,8 @@
 {
 	if (info->prefix[0] != '\0')
 		printf("%snflog-prefix \"%s\" ", prefix, info->prefix);
-	if (info->group != XT_NFLOG_DEFAULT_GROUP)
-		printf("%snflog-group %u ", prefix, ffs(info->group));
+	if (info->group)
+		printf("%snflog-group %u ", prefix, info->group);
 	if (info->len)
 		printf("%snflog-range %u ", prefix, info->len);
 	if (info->threshold != XT_NFLOG_DEFAULT_THRESHOLD)

Modified: trunk/iptables/extensions/libipt_NFLOG.c
===================================================================
--- trunk/iptables/extensions/libipt_NFLOG.c	2007-02-27 20:30:46 UTC (rev 6764)
+++ trunk/iptables/extensions/libipt_NFLOG.c	2007-03-06 02:00:32 UTC (rev 6765)
@@ -35,7 +35,7 @@
 {
 	struct xt_nflog_info *info = (struct xt_nflog_info *)t->data;
 
-	info->group	= XT_NFLOG_DEFAULT_GROUP;
+	info->group	= 0;
 	info->threshold	= XT_NFLOG_DEFAULT_THRESHOLD;
 }
 
@@ -56,10 +56,10 @@
 				   "Unexpected `!' after --nflog-group");
 
 		n = atoi(optarg);
-		if (n < 1 || n > 32)
+		if (n < 0)
 			exit_error(PARAMETER_PROBLEM,
-				   "--nflog-group has to be between 1 and 32");
-		info->group = 1 << (n - 1);
+				   "--nflog-group can not be negative");
+		info->group = n;
 		break;
 	case NFLOG_PREFIX:
 		if (*flags & NFLOG_PREFIX)
@@ -118,8 +118,8 @@
 {
 	if (info->prefix[0] != '\0')
 		printf("%snflog-prefix \"%s\" ", prefix, info->prefix);
-	if (info->group != XT_NFLOG_DEFAULT_GROUP)
-		printf("%snflog-group %u ", prefix, ffs(info->group));
+	if (info->group)
+		printf("%snflog-group %u ", prefix, info->group);
 	if (info->len)
 		printf("%snflog-range %u ", prefix, info->len);
 	if (info->threshold != XT_NFLOG_DEFAULT_THRESHOLD)




More information about the netfilter-cvslog mailing list