Hi,
I attached the patch file for optarg. It includes patches for iptables.c and ip6tables.c.

regards,
Ozgur Akan

Ozgur Akan wrote:
Hi,

I think using optarg instead of argv[optind-1] will be better. In iptables.c; while parsing iptables options with getopt_long, argv[optind-1] is used in 8 places.

optarg (option argument) gives us the value of the option we are parsing. So when we do something with the argument of (for example) A option the easiest way to get the value of A`s argument is using optarg. optarg is designed to be used with getopt_long.

Using optind (option index) is more tricky because optind starts from 1 and when we are parsing an option with an index of value n of argv array it shows n+2. That`s why we substract 1 from optind.

best wishes,

Ozgur Akan