[PATCH] psd option parsing

Phil Oester kernel at linuxace.com
Sat Sep 18 01:49:02 CEST 2004


psd match is too greedy with options, and doesn't play well with
other matches.  For example:

	# iptables -A INPUT -m psd -m recent --set -j DROP
	iptables v1.2.11: missing optarg
	Try `iptables -h' or 'iptables --help' for more information.

Below patch makes it less greedy.

This fixes bugzilla #18

Phil


-------------- next part --------------
diff -ru ipt-orig/extensions/libipt_psd.c ipt-new/extensions/libipt_psd.c
--- ipt-orig/extensions/libipt_psd.c	2003-07-14 16:01:29.000000000 -0400
+++ ipt-new/extensions/libipt_psd.c	2004-09-17 19:44:33.900825504 -0400
@@ -84,11 +84,6 @@
 	struct ipt_psd_info *psdinfo = (struct ipt_psd_info *)(*match)->data;
 	unsigned int num;
 	
-	if (!optarg)
-		exit_error(PARAMETER_PROBLEM, "missing optarg");
-
-	/* string_to_number needs a leading space */
-
 	switch (c) {
 	/* PSD-weight-threshold */
 	case '1':


More information about the netfilter-devel mailing list