Re: [PATCH] libxtables: define xtables_free_opts()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-02-11 at 16:17 +0100, Jan Engelhardt wrote:
> On Monday 2009-02-09 22:01, jamal wrote:

> 
> >+void xtables_free_opts(int reset_offset, struct option *original_opts)
> >+{
> >+	if (xt_params->opts != original_opts) {
> >+		if (original_opts) 
> >+			free(xt_params->opts);
> >+		xt_params->opts = original_opts;
> >+		if (reset_offset)
> >+			xt_params->option_offset = 0;
> >+	}
> >+}
> >+
> 
> While this may have been just moved from iptables.c or so
> (where? I do not see any deletions or conversions of code
> that is supposed to make use of xtables_free_opts!)
> this function needs some comments to explain just why
> it is supposed to be doing this.

I use it in a version of tc/m_xt.c i am working on but hadnt
made the changes to iptables and friends at this point. I
do that in later patches and did change it back to the original 
version in the "merge_options"  patch; so in the new version it looks
like regular free_opts(). So now it looks like:

-----
void xtables_free_opts(int reset_offset)
{
        if (xt_params->opts != xt_params->orig_opts) {
                free(xt_params->opts);
                xt_params->opts = xt_params->orig_opts;
                if (reset_offset)
                        xt_params->option_offset = 0;
        }
}
-------------


cheers,
jamal

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux