Re: [PATCH] xtables-addons 3.18 condition - Improved network namespace support

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

 



On 2021-08-22, at 18:14:13 +0200, Grzegorz Kuczyński wrote:
> My intention was removed special var 'after_clear'. The main idea was
> use a list as a flag.
>
> But Jeremy has right, I used list_empty_careful() in wrong place.
> I can change this for that:
>
>         static void condition_mt_destroy(const struct xt_mtdtor_param *par)
>         {
>                 const struct xt_condition_mtinfo *info = par->matchinfo;
>                 struct condition_variable *var = info->condvar;
>                 struct condition_net *cnet = get_condition_pernet(par->net);
>         
>                 mutex_lock(&proc_lock);
>                 // is called after net namespace deleted?
>                 if (list_empty_careful(&cnet->conditions_list)) {
>                         mutex_unlock(&proc_lock);
>                         return;
>                 }
>                 if (--var->refcount == 0) {
>                         list_del(&var->list);
>                         remove_proc_entry(var->name, cnet->proc_net_condition);
>                         mutex_unlock(&proc_lock);
>                         kfree(var);
>                         return;
>                 }
>                 mutex_unlock(&proc_lock);
>         }
>
> But now I realized that one var bool is less expensive than call a
> function.  So my improved is turned out the fail :) ... sorry for
> taking the time.

I think there are some improvements that can be made.  Will send
patches.

J.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux