Skip to contentSkip to conversation

psd option parsing

PATCH Applied Phil Oester 2 participants 2 messages Sep 17, 2004 – Sep 18, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 psd option parsing

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

extensions/libipt_psd.c +0 -5
diff -ru ipt-orig/extensions/libipt_psd.c ipt-new/extensions/libipt_psd.c
@@ -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':
#1 lore raw
Quoted 12 lines · Phil Oester

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

Applied, thanks.

Quoted 2 lines

Phil