Subject: Re: few more fixes for iproute2/m_ipt

From: jamal <[email-masked]>
Date: Wed, 06 Aug 2008 08:46:00 -0400

On Wed, 2008-06-08 at 14:26 +0300, Denys Fedoryshchenko wrote:

> Is it better like this?
> 
> Sure optind is up to you, for me it is not clear yet how it works.
> 
> Just i notice in iptables.c, function do_command where they set optind to zero 
> and in comments /*re-set optind to zero in case do_command gets called second 
> time */

I have done extensive testing with and with optind=0 and optind=1 and i
didnt see any breakage with either.

I have a feeling that setting optind to 0 in your case to avoid the
crash maybe hiding something else - but i cant find what that something
else is since i am just simulating what you are doing.
If the iptables folks have changed it to reset to 0, then I dont see any
harm in resetting. 

So ACK to both your patches.

cheers,
jamal
PS:- dont wanna sound anal - and you dont have to do this if you dont
have time; but if you put the resetting of optind and the flags in a
separate patch from the freeing, that would be even better.