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]
Message-ID: <CAKfmpSdrG9x24TZQ2M2xV_e7CFedE9WWUmtD2Vz8c2H5roneOA@mail.gmail.com>
Date:   Sat, 5 Dec 2020 11:13:45 -0500
From:   Jarod Wilson <jarod@...hat.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Ivan Vecera <ivecera@...hat.com>,
        Jay Vosburgh <j.vosburgh@...il.com>,
        Veaceslav Falico <vfalico@...il.com>,
        Andy Gospodarek <andy@...yhouse.net>,
        "David S. Miller" <davem@...emloft.net>,
        Thomas Davis <tadavis@....gov>, Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net v3] bonding: fix feature flag setting at init time

On Thu, Dec 3, 2020 at 11:45 AM Jakub Kicinski <kuba@...nel.org> wrote:
...
> nit: let's narrow down the ifdef-enery
>
> no need for the ifdef here, if the helper looks like this:
>
> +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode)
> +{
> +#ifdef CONFIG_XFRM_OFFLOAD
> +       if (mode == BOND_MODE_ACTIVEBACKUP)
> +               bond_dev->wanted_features |= BOND_XFRM_FEATURES;
> +       else
> +               bond_dev->wanted_features &= ~BOND_XFRM_FEATURES;
> +
> +       netdev_update_features(bond_dev);
> +#endif /* CONFIG_XFRM_OFFLOAD */
> +}
>
> Even better:
>
> +static void bond_set_xfrm_features(struct net_device *bond_dev, u64 mode)
> +{
> +       if (!IS_ENABLED(CONFIG_XFRM_OFFLOAD))
> +               return;
> +
> +       if (mode == BOND_MODE_ACTIVEBACKUP)
> +               bond_dev->wanted_features |= BOND_XFRM_FEATURES;
> +       else
> +               bond_dev->wanted_features &= ~BOND_XFRM_FEATURES;
> +
> +       netdev_update_features(bond_dev);
> +}
>
> (Assuming BOND_XFRM_FEATURES doesn't itself hide under an ifdef.)

It is, but doesn't need to be. I can mix these changes in as well.

-- 
Jarod Wilson
jarod@...hat.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ