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: <542DF6FA.4050107@lab.ntt.co.jp>
Date:	Fri, 03 Oct 2014 10:08:10 +0900
From:	Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
To:	Vladislav Yasevich <vyasevich@...il.com>, netdev@...r.kernel.org
CC:	stephen@...workplumber.org, bridge@...ts.linux-foundation.org,
	toshiaki.makita1@...il.com,
	Vladislav Yasevich <vyasevic@...hat.com>
Subject: Re: [PATCH v3 net-next 1/3] bridge: Add a default_pvid sysfs attribute

On 2014/10/03 8:54, Vladislav Yasevich wrote:
> This patch allows the user to set and retrieve default_pvid
> value.  A new value can only be stored when vlan filtering
> is disabled.
> 
> Signed-off-by: Vladislav Yasevich <vyasevic@...hat.com>
> ---
...
> +int br_vlan_set_default_pvid(struct net_bridge *br, unsigned long val)
> +{
> +	u16 pvid = val;
> +	int err = 0;
> +
> +	if (!val || val >= VLAN_VID_MASK)
> +		return -EINVAL;
> +
> +	if (!rtnl_trylock())
> +		return restart_syscall();
> +
> +	if (pvid == br->default_pvid)
> +		goto unlock;
> +
> +	/* Only allow default pvid change when filtering is disabled */
> +	if (br->vlan_enabled) {
> +		pr_info_once("Please disable vlan filtering to change default_pvid\n");
> +		err = -EPERM;
> +		goto unlock;
> +	}
> +
> +	br->default_pvid = vid;

typo: s/vid/pvid/

Thanks,
Toshiaki Makita

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ