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] [day] [month] [year] [list]
Message-Id: <20200827.071408.2257489516960391705.davem@davemloft.net>
Date:   Thu, 27 Aug 2020 07:14:08 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     mkubecek@...e.cz
Cc:     fabf@...net.be, kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/7 net-next] vxlan: add VXLAN_NL2FLAG macro

From: Michal Kubecek <mkubecek@...e.cz>
Date: Thu, 27 Aug 2020 11:50:25 +0200

> On Thu, Aug 27, 2020 at 08:50:19AM +0200, Fabian Frederick wrote:
>> Replace common flag assignment with a macro.
>> This could yet be simplified with changelink/supported but it would
>> remove clarity
>> 
>> Signed-off-by: Fabian Frederick <fabf@...net.be>
>> ---
> [...]
>> diff --git a/include/net/vxlan.h b/include/net/vxlan.h
>> index 3a41627cbdfe5..8a56b7a0f75f9 100644
>> --- a/include/net/vxlan.h
>> +++ b/include/net/vxlan.h
>> @@ -290,6 +290,16 @@ struct vxlan_dev {
>>  					 VXLAN_F_UDP_ZERO_CSUM6_RX |	\
>>  					 VXLAN_F_COLLECT_METADATA)
>>  
>> +
>> +#define VXLAN_NL2FLAG(iflag, flag, changelink, changelink_supported) {   \
>> +	if (data[iflag]) {						 \
>> +		err = vxlan_nl2flag(conf, data, iflag, flag, changelink, \
>> +				    changelink_supported, extack);       \
>> +		if (err)						 \
>> +			return err;					 \
>> +	}								 \
>> +}
>> +
> 
> Hiding a goto or return in a macro is generally discouraged as it may
> confuse people reading or updating the code.

Agreed, please don't do this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ