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:   Tue, 19 Jan 2021 18:35:06 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     David Ahern <dsahern@...il.com>
Cc:     Petr Machata <petrm@...dia.com>, netdev@...r.kernel.org,
        David Ahern <dsahern@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Ido Schimmel <idosch@...dia.com>
Subject: Re: [PATCH net-next 1/3] nexthop: Use a dedicated policy for
 nh_valid_get_del_req()

On Tue, 19 Jan 2021 19:28:40 -0700 David Ahern wrote:
> On 1/19/21 1:55 PM, Jakub Kicinski wrote:
> >> diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
> >> index e53e43aef785..d5d88f7c5c11 100644
> >> --- a/net/ipv4/nexthop.c
> >> +++ b/net/ipv4/nexthop.c
> >> @@ -36,6 +36,10 @@ static const struct nla_policy rtm_nh_policy[NHA_MAX + 1] = {
> >>  	[NHA_FDB]		= { .type = NLA_FLAG },
> >>  };
> >>  
> >> +static const struct nla_policy rtm_nh_policy_get[NHA_MAX + 1] = {  
> > 
> > This is an unnecessary waste of memory if you ask me.
> > 
> > NHA_ID is 1, so we're creating an array of 10 extra NULL elements.
> > 
> > Can you leave the size to the compiler and use ARRAY_SIZE() below?  
> 
> interesting suggestion in general for netlink attributes.

According to tags on commit ff419afa4310 ("ethtool: trim policy
tables") the credit goes to Johannes :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ