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: <wihy3h8txlu.fsf@dev-r-vrt-156.mtr.labs.mlnx>
Date:   Fri, 27 Apr 2018 19:36:45 +0300
From:   Petr Machata <petrm@...lanox.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     Ido Schimmel <idosch@...lanox.com>, netdev@...r.kernel.org,
        bridge@...ts.linux-foundation.org, davem@...emloft.net,
        jiri@...lanox.com, nikolay@...ulusnetworks.com, mlxsw@...lanox.com
Subject: Re: [PATCH net-next v2 1/6] net: bridge: Publish bridge accessor functions

Stephen Hemminger <stephen@...workplumber.org> writes:

> On Fri, 27 Apr 2018 18:11:06 +0300
> Ido Schimmel <idosch@...lanox.com> wrote:
>
>> +int br_vlan_pvid_rtnl(const struct net_device *dev, u16 *p_pvid)
>> +{
>> +	struct net_bridge_vlan_group *vg;
>> +
>> +	ASSERT_RTNL();
>> +	if (netif_is_bridge_master(dev))
>> +		vg = br_vlan_group(netdev_priv(dev));
>> +	else
>> +		return -EINVAL;
>> +
>> +	*p_pvid = br_get_pvid(vg);
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(br_vlan_pvid_rtnl);
>
> Unless there is a RCU version, no need for _rtnl suffix.

All right, I wanted to be explicit, but if you prefer to drop the _rtnl,
no problem.

> Minor style issue, why not make error then go on and return -1 on error.

Basically to make it more straightforward to extend when people want to
add support for the other device kind (bridge / port).

>
>
> int br_vlan_pvid(const struct net_device *dev)
> {
> 	const struct net_bridge_vlan_group *vg;
>
> 	ASSERT_RTNL();
>
> 	if (!netif_is_bridge_master(dev))
> 		return -1;
>
> 	vg = br_vlan_group(netdev_priv(dev));
> 	return br_get_pvid(vg);
> }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ