@@ -8,7 +8,8 @@ use serde::Serialize;
88use iproute_rs:: mac_to_string;
99
1010/// Format bridge ID to match iproute2's format:
11- /// Priority is 4 hex digits, MAC address bytes use minimal formatting (no leading zeros for bytes < 0x10)
11+ /// Priority is 4 hex digits, MAC address bytes use minimal formatting (no
12+ /// leading zeros for bytes < 0x10)
1213fn format_bridge_id ( priority : u16 , mac_bytes : [ u8 ; 6 ] ) -> String {
1314 format ! (
1415 "{:04x}.{:x}:{:x}:{:x}:{:x}:{:x}:{:x}" ,
@@ -32,7 +33,6 @@ const IFLA_BR_FDB_N_LEARNED: u16 = 48;
3233const IFLA_BR_FDB_MAX_LEARNED : u16 = 49 ;
3334const IFLA_BR_NO_LL_LEARN : u16 = 51 ;
3435const IFLA_BR_VLAN_MCAST_SNOOPING : u16 = 52 ;
35- const IFLA_BR_MST_ENABLED : u16 = 53 ;
3636
3737#[ derive( Serialize ) ]
3838#[ serde( untagged) ]
@@ -72,15 +72,11 @@ pub(crate) enum CliLinkInfoData {
7272 bcast_flood : bool ,
7373 mcast_to_unicast : bool ,
7474 neigh_suppress : bool ,
75- #[ serde( skip_serializing_if = "Option::is_none" ) ]
76- neigh_vlan_suppress : Option < bool > ,
7775 group_fwd_mask : String ,
7876 group_fwd_mask_str : String ,
7977 vlan_tunnel : bool ,
8078 isolated : bool ,
8179 locked : bool ,
82- #[ serde( skip_serializing_if = "Option::is_none" ) ]
83- mab : Option < bool > ,
8480 } ,
8581 Bridge {
8682 forward_delay : u32 ,
@@ -118,7 +114,6 @@ pub(crate) enum CliLinkInfoData {
118114 mcast_snooping : u8 ,
119115 no_linklocal_learn : u8 ,
120116 mcast_vlan_snooping : u8 ,
121- mst_enabled : u8 ,
122117 mcast_router : u8 ,
123118 mcast_query_use_ifaddr : u8 ,
124119 mcast_querier : u8 ,
@@ -204,12 +199,10 @@ impl CliLinkInfoData {
204199 let mut bcast_flood = false ;
205200 let mut mcast_to_unicast = false ;
206201 let mut neigh_suppress = false ;
207- let mut neigh_vlan_suppress = None ;
208202 let mut group_fwd_mask: u16 = 0 ;
209203 let mut vlan_tunnel = false ;
210204 let mut isolated = false ;
211205 let mut locked = false ;
212- let mut mab = None ;
213206
214207 for nla in info_bridge_port {
215208 match nla {
@@ -292,14 +285,10 @@ impl CliLinkInfoData {
292285 mcast_to_unicast = * v
293286 }
294287 InfoBridgePort :: NeighSupress ( v) => neigh_suppress = * v,
295- InfoBridgePort :: NeighVlanSupress ( v) => {
296- neigh_vlan_suppress = Some ( * v)
297- }
298288 InfoBridgePort :: GroupFwdMask ( v) => group_fwd_mask = * v,
299289 InfoBridgePort :: VlanTunnel ( v) => vlan_tunnel = * v,
300290 InfoBridgePort :: Isolated ( v) => isolated = * v,
301291 InfoBridgePort :: Locked ( v) => locked = * v,
302- InfoBridgePort :: Mab ( v) => mab = Some ( * v) ,
303292 _ => ( ) ,
304293 }
305294 }
@@ -340,13 +329,11 @@ impl CliLinkInfoData {
340329 bcast_flood,
341330 mcast_to_unicast,
342331 neigh_suppress,
343- neigh_vlan_suppress,
344332 group_fwd_mask : group_fwd_mask_string,
345333 group_fwd_mask_str,
346334 vlan_tunnel,
347335 isolated,
348336 locked,
349- mab,
350337 }
351338 }
352339 _ => todo ! ( "Other port types not yet implemented" ) ,
@@ -405,7 +392,6 @@ impl CliLinkInfoData {
405392 let mut fdb_max_learned = None ;
406393 let mut no_linklocal_learn = 0 ;
407394 let mut mcast_vlan_snooping = 0 ;
408- let mut mst_enabled = 0 ;
409395
410396 for nla in info_bridge {
411397 match nla {
@@ -533,11 +519,6 @@ impl CliLinkInfoData {
533519 nla. emit_value ( & mut val) ;
534520 mcast_vlan_snooping = val[ 0 ] ;
535521 }
536- IFLA_BR_MST_ENABLED => {
537- let mut val = [ 0u8 ; 1 ] ;
538- nla. emit_value ( & mut val) ;
539- mst_enabled = val[ 0 ] ;
540- }
541522 _ => ( ) ,
542523 }
543524 }
@@ -576,7 +557,6 @@ impl CliLinkInfoData {
576557 mcast_snooping,
577558 no_linklocal_learn,
578559 mcast_vlan_snooping,
579- mst_enabled,
580560 mcast_router,
581561 mcast_query_use_ifaddr,
582562 mcast_querier,
@@ -811,13 +791,11 @@ impl std::fmt::Display for CliLinkInfoData {
811791 bcast_flood,
812792 mcast_to_unicast,
813793 neigh_suppress,
814- neigh_vlan_suppress,
815794 group_fwd_mask,
816795 group_fwd_mask_str,
817796 vlan_tunnel,
818797 isolated,
819798 locked,
820- mab,
821799 } => {
822800 let format_timer = |val : u64 | -> String {
823801 let seconds = val as f64 / 100.0 ;
@@ -866,21 +844,11 @@ impl std::fmt::Display for CliLinkInfoData {
866844 write ! ( f, "bcast_flood {} " , on_off( * bcast_flood) ) ?;
867845 write ! ( f, "mcast_to_unicast {} " , on_off( * mcast_to_unicast) ) ?;
868846 write ! ( f, "neigh_suppress {} " , on_off( * neigh_suppress) ) ?;
869- if let Some ( v) = neigh_vlan_suppress {
870- write ! ( f, "neigh_vlan_suppress {} " , on_off( * v) ) ?;
871- } else {
872- write ! ( f, "neigh_vlan_suppress off " ) ?;
873- }
874847 write ! ( f, "group_fwd_mask {} " , group_fwd_mask) ?;
875848 write ! ( f, "group_fwd_mask_str {} " , group_fwd_mask_str) ?;
876849 write ! ( f, "vlan_tunnel {} " , on_off( * vlan_tunnel) ) ?;
877850 write ! ( f, "isolated {} " , on_off( * isolated) ) ?;
878851 write ! ( f, "locked {} " , on_off( * locked) ) ?;
879- if let Some ( v) = mab {
880- write ! ( f, "mab {}" , on_off( * v) ) ?;
881- } else {
882- write ! ( f, "mab off" ) ?;
883- }
884852 }
885853 CliLinkInfoData :: Veth => ( ) ,
886854 CliLinkInfoData :: Bond {
@@ -957,7 +925,6 @@ impl std::fmt::Display for CliLinkInfoData {
957925 mcast_snooping,
958926 no_linklocal_learn,
959927 mcast_vlan_snooping,
960- mst_enabled,
961928 mcast_router,
962929 mcast_query_use_ifaddr,
963930 mcast_querier,
@@ -1038,7 +1005,6 @@ impl std::fmt::Display for CliLinkInfoData {
10381005 write ! ( f, "mcast_snooping {} " , mcast_snooping) ?;
10391006 write ! ( f, "no_linklocal_learn {} " , no_linklocal_learn) ?;
10401007 write ! ( f, "mcast_vlan_snooping {} " , mcast_vlan_snooping) ?;
1041- write ! ( f, "mst_enabled {} " , mst_enabled) ?;
10421008 write ! ( f, "mcast_router {} " , mcast_router) ?;
10431009 write ! (
10441010 f,
@@ -1135,7 +1101,8 @@ impl CliLinkInfoKindNData {
11351101 // but skip this for now - we'll handle it separately
11361102 }
11371103 LinkInfo :: PortData ( _data) => {
1138- // Skip port data in this structure - it's handled separately
1104+ // Skip port data in this structure - it's handled
1105+ // separately
11391106 }
11401107 _ => ( ) ,
11411108 }
0 commit comments