aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r--net/bridge/br_netlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index fe1980d5a7e4..e044cc0b5650 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -120,6 +120,7 @@ static int br_fill_ifinfo(struct sk_buff *skb,
120 const struct net_port_vlans *pv; 120 const struct net_port_vlans *pv;
121 struct bridge_vlan_info vinfo; 121 struct bridge_vlan_info vinfo;
122 u16 vid; 122 u16 vid;
123 u16 pvid;
123 124
124 if (port) 125 if (port)
125 pv = nbp_get_vlan_info(port); 126 pv = nbp_get_vlan_info(port);
@@ -133,12 +134,15 @@ static int br_fill_ifinfo(struct sk_buff *skb,
133 if (!af) 134 if (!af)
134 goto nla_put_failure; 135 goto nla_put_failure;
135 136
137 pvid = br_get_pvid(pv);
136 for (vid = find_first_bit(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN); 138 for (vid = find_first_bit(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN);
137 vid < BR_VLAN_BITMAP_LEN; 139 vid < BR_VLAN_BITMAP_LEN;
138 vid = find_next_bit(pv->vlan_bitmap, 140 vid = find_next_bit(pv->vlan_bitmap,
139 BR_VLAN_BITMAP_LEN, vid+1)) { 141 BR_VLAN_BITMAP_LEN, vid+1)) {
140 vinfo.vid = vid; 142 vinfo.vid = vid;
141 vinfo.flags = 0; 143 vinfo.flags = 0;
144 if (vid == pvid)
145 vinfo.flags |= BRIDGE_VLAN_INFO_PVID;
142 if (nla_put(skb, IFLA_BRIDGE_VLAN_INFO, 146 if (nla_put(skb, IFLA_BRIDGE_VLAN_INFO,
143 sizeof(vinfo), &vinfo)) 147 sizeof(vinfo), &vinfo))
144 goto nla_put_failure; 148 goto nla_put_failure;
@@ -239,14 +243,15 @@ static int br_afspec(struct net_bridge *br,
239 switch (cmd) { 243 switch (cmd) {
240 case RTM_SETLINK: 244 case RTM_SETLINK:
241 if (p) { 245 if (p) {
242 err = nbp_vlan_add(p, vinfo->vid); 246 err = nbp_vlan_add(p, vinfo->vid, vinfo->flags);
243 if (err) 247 if (err)
244 break; 248 break;
245 249
246 if (vinfo->flags & BRIDGE_VLAN_INFO_MASTER) 250 if (vinfo->flags & BRIDGE_VLAN_INFO_MASTER)
247 err = br_vlan_add(p->br, vinfo->vid); 251 err = br_vlan_add(p->br, vinfo->vid,
252 vinfo->flags);
248 } else 253 } else
249 err = br_vlan_add(br, vinfo->vid); 254 err = br_vlan_add(br, vinfo->vid, vinfo->flags);
250 255
251 if (err) 256 if (err)
252 break; 257 break;