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: <56bb2f2e-4ed2-8ec4-0ea1-b00781a7e4b3@cumulusnetworks.com>
Date:   Mon, 26 Nov 2018 19:41:30 +0200
From:   Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
        roopa@...ulusnetworks.com, davem@...emloft.net,
        bridge@...ts.linux-foundation.org
Subject: Re: [PATCH net-next v2 1/3] net: bridge: add support for
 user-controlled bool options

On 26/11/2018 19:39, Stephen Hemminger wrote:
> On Sun, 25 Nov 2018 10:12:45 +0200
> Nikolay Aleksandrov <nikolay@...ulusnetworks.com> wrote:
> 
>> On 24/11/2018 18:46, nikolay@...ulusnetworks.com wrote:
>>> On 24 November 2018 18:25:41 EET, Andrew Lunn <andrew@...n.ch> wrote:  
>>>> On Sat, Nov 24, 2018 at 06:18:33PM +0200, nikolay@...ulusnetworks.com
>>>> wrote:  
>>>>> On 24 November 2018 18:10:41 EET, Andrew Lunn <andrew@...n.ch> wrote:  
>>>>>>> +int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id  
>>>> opt,  
>>>>>> bool on,  
>>>>>>> +		      struct netlink_ext_ack *extack)
>>>>>>> +{
>>>>>>> +	switch (opt) {
>>>>>>> +	default:
>>>>>>> +		/* shouldn't be called with unsupported options */
>>>>>>> +		WARN_ON(1);
>>>>>>> +		break;  
>>>>>>
>>>>>> So you return 0 here, meaning the br_debug() lower down will not
>>>>>> happen. Maybe return -EOPNOTSUPP?
>>>>>>  
>>>>>
>>>>> No, the idea here is that some option in the future might return an  
>>>> error.   
>>>>> This function cannot be called with unsupported option thus the warn.  
> 
>>
> 
> Please don't implement some part of the API until it is used (YAGNI).
> If do this kind of "someday will come" design the code will end up
> littered with dead ends.
> 

Is there anything unused ? This is just a precaution to catch future
offenders which forget to handle options where they're expected.
All of the API is used.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ