vlan: Change vlan_dev_set_vlan_flag() to handle multiple flags at once
Change vlan_dev_set_vlan_flag() to handle multiple flags at once and rename to vlan_dev_change_flags(). This allows to to use it from the netlink interface, which in turn allows to handle necessary adjustments when changing flags centrally. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
eca9ebac65
commit
b3ce0325f2
@ -75,7 +75,6 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||
static int vlan_changelink(struct net_device *dev,
|
||||
struct nlattr *tb[], struct nlattr *data[])
|
||||
{
|
||||
struct vlan_dev_info *vlan = vlan_dev_info(dev);
|
||||
struct ifla_vlan_flags *flags;
|
||||
struct ifla_vlan_qos_mapping *m;
|
||||
struct nlattr *attr;
|
||||
@ -83,8 +82,7 @@ static int vlan_changelink(struct net_device *dev,
|
||||
|
||||
if (data[IFLA_VLAN_FLAGS]) {
|
||||
flags = nla_data(data[IFLA_VLAN_FLAGS]);
|
||||
vlan->flags = (vlan->flags & ~flags->mask) |
|
||||
(flags->flags & flags->mask);
|
||||
vlan_dev_change_flags(dev, flags->flags, flags->mask);
|
||||
}
|
||||
if (data[IFLA_VLAN_INGRESS_QOS]) {
|
||||
nla_for_each_nested(attr, data[IFLA_VLAN_INGRESS_QOS], rem) {
|
||||
|
Reference in New Issue
Block a user