lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Jul 2017 13:37:21 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Jiri Pirko <jiri@...nulli.us>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Daniel Borkmann <daniel@...earbox.net>, mlxsw@...lanox.com
Subject: Re: [patch net-next 04/20] net: sched: use tcf_exts_has_actions in tcf_exts_exec

On Fri, Jul 28, 2017 at 7:40 AM, Jiri Pirko <jiri@...nulli.us> wrote:
> +static inline int
> +tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
> +             struct tcf_result *res)
> +{
> +#ifdef CONFIG_NET_CLS_ACT
> +       if (tcf_exts_has_actions(exts))
> +               return tcf_action_exec(skb, exts->actions, exts->nr_actions,
> +                                      res);
> +#endif
> +       return 0;
> +}


While you are on it, can we get rid of this macro too?

tcf_action_exec() is only defined with CONFIG_NET_CLS_ACT,
not sure if compiler is kind enough to eliminate the false branch
for us:

if (false)
    return tcf_action_exec(...); // not defined but the branch is dead

At least you can add a wrapper for tcf_action_exec() to just
return 0.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ