@@ -1547,7 +1547,9 @@ void br_vlan_port_event(struct net_bridge_port *p, unsigned long event)
1547
1547
}
1548
1548
}
1549
1549
1550
+ /* v_opts is used to dump the options which must be equal in the whole range */
1550
1551
static bool br_vlan_fill_vids (struct sk_buff * skb , u16 vid , u16 vid_range ,
1552
+ const struct net_bridge_vlan * v_opts ,
1551
1553
u16 flags )
1552
1554
{
1553
1555
struct bridge_vlan_info info ;
@@ -1572,6 +1574,9 @@ static bool br_vlan_fill_vids(struct sk_buff *skb, u16 vid, u16 vid_range,
1572
1574
nla_put_u16 (skb , BRIDGE_VLANDB_ENTRY_RANGE , vid_range ))
1573
1575
goto out_err ;
1574
1576
1577
+ if (v_opts && !br_vlan_opts_fill (skb , v_opts ))
1578
+ goto out_err ;
1579
+
1575
1580
nla_nest_end (skb , nest );
1576
1581
1577
1582
return true;
@@ -1586,7 +1591,8 @@ static size_t rtnl_vlan_nlmsg_size(void)
1586
1591
return NLMSG_ALIGN (sizeof (struct br_vlan_msg ))
1587
1592
+ nla_total_size (0 ) /* BRIDGE_VLANDB_ENTRY */
1588
1593
+ nla_total_size (sizeof (u16 )) /* BRIDGE_VLANDB_ENTRY_RANGE */
1589
- + nla_total_size (sizeof (struct bridge_vlan_info )); /* BRIDGE_VLANDB_ENTRY_INFO */
1594
+ + nla_total_size (sizeof (struct bridge_vlan_info )) /* BRIDGE_VLANDB_ENTRY_INFO */
1595
+ + br_vlan_opts_nl_size (); /* bridge vlan options */
1590
1596
}
1591
1597
1592
1598
void br_vlan_notify (const struct net_bridge * br ,
@@ -1595,7 +1601,7 @@ void br_vlan_notify(const struct net_bridge *br,
1595
1601
int cmd )
1596
1602
{
1597
1603
struct net_bridge_vlan_group * vg ;
1598
- struct net_bridge_vlan * v ;
1604
+ struct net_bridge_vlan * v = NULL ;
1599
1605
struct br_vlan_msg * bvm ;
1600
1606
struct nlmsghdr * nlh ;
1601
1607
struct sk_buff * skb ;
@@ -1647,7 +1653,7 @@ void br_vlan_notify(const struct net_bridge *br,
1647
1653
goto out_kfree ;
1648
1654
}
1649
1655
1650
- if (!br_vlan_fill_vids (skb , vid , vid_range , flags ))
1656
+ if (!br_vlan_fill_vids (skb , vid , vid_range , v , flags ))
1651
1657
goto out_err ;
1652
1658
1653
1659
nlmsg_end (skb , nlh );
@@ -1665,7 +1671,8 @@ static bool br_vlan_can_enter_range(const struct net_bridge_vlan *v_curr,
1665
1671
const struct net_bridge_vlan * range_end )
1666
1672
{
1667
1673
return v_curr -> vid - range_end -> vid == 1 &&
1668
- range_end -> flags == v_curr -> flags ;
1674
+ range_end -> flags == v_curr -> flags &&
1675
+ br_vlan_opts_eq (v_curr , range_end );
1669
1676
}
1670
1677
1671
1678
static int br_vlan_dump_dev (const struct net_device * dev ,
@@ -1729,7 +1736,8 @@ static int br_vlan_dump_dev(const struct net_device *dev,
1729
1736
u16 flags = br_vlan_flags (range_start , pvid );
1730
1737
1731
1738
if (!br_vlan_fill_vids (skb , range_start -> vid ,
1732
- range_end -> vid , flags )) {
1739
+ range_end -> vid , range_start ,
1740
+ flags )) {
1733
1741
err = - EMSGSIZE ;
1734
1742
break ;
1735
1743
}
@@ -1748,7 +1756,7 @@ static int br_vlan_dump_dev(const struct net_device *dev,
1748
1756
*/
1749
1757
if (!err && range_start &&
1750
1758
!br_vlan_fill_vids (skb , range_start -> vid , range_end -> vid ,
1751
- br_vlan_flags (range_start , pvid )))
1759
+ range_start , br_vlan_flags (range_start , pvid )))
1752
1760
err = - EMSGSIZE ;
1753
1761
1754
1762
cb -> args [1 ] = err ? idx : 0 ;
0 commit comments