All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables.c changes submitted argv value
@ 2004-08-11 12:09 Sascha
  2004-08-11 21:23 ` Henrik Nordstrom
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha @ 2004-08-11 12:09 UTC (permalink / raw)
  To: netfilter-devel

Hi,

can anyone tell me why it's necessary to set optarg[0] in case of '!' to
'\0'?

iptables.c line 2010
---
case 1: /* non option */
	if (optarg[0] == '!' && optarg[1] == '\0') {
      	if (invert)
            	exit_error(PARAMETER_PROBLEM,
                  		"multiple consecutive ! not"
                              " allowed");
                  invert = TRUE;
----->            optarg[0] = '\0';
                  continue;
       }
     	 printf("Bad argument `%s'\n", optarg);
       exit_tryhelp(2);
---

I don't search a solution for this, only an explanation.

The Problem is i wanna build a deamon with iptables, which load's a static
ruleset on init. In case of:

---
deamon -A INPUT -m mark ! --mark 0 -j IDS
deamon -A OUTPUT -m mark ! --mark 0 -j IDS
---

... my init crashes with "Bad Argument ''", because do_command in iptables
changes my values ('!' to '\0')
for the ! in the second line (output-rule) ...

Thanks & Regards
Sascha

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-13  2:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <IDEAKKJENKGNPNLKJKODOEAECAAA.listuser@epygi.de>
2004-08-12 11:11 ` iptables.c changes submitted argv value Henrik Nordstrom
2004-08-13  0:05   ` Philip Craig
2004-08-13  2:01     ` Ben Efros
2004-08-11 12:09 Sascha
2004-08-11 21:23 ` Henrik Nordstrom

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.