Subject: Re: iproute2/m_ipt fix, opts was not set properly

From: jamal <[email-masked]>
Date: Wed, 06 Aug 2008 06:52:25 -0400

On Wed, 2008-06-08 at 06:42 -0400, jamal wrote:

> Sorry Denys, unless my memory has lost the C scoping rules, i dont think
> the shadowing you describe above is accurate. Let me take a closer look.

Grrr. I see the bug; until you tested with batching, it probably hasnt
mattered.
I still dont see how your patch fixes it. But heres a fix that I think
will work:

1. change free_opts to be:

static void free_opts(struct option **opts)
{
        if (*opts != original_opts) {
                free(*opts);
                *opts = original_opts;
        }
}

2. Change invocations of free_opts to be:

free_opts(&opts);

cheers,
jamal