File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,13 @@ fn route_show(is_ipv6: bool) -> std::io::Result<Vec<(IpCidr, Vec<String>)>> {
135135
136136 let mut split = line. split_whitespace ( ) ;
137137 let mut dst_str = split. next ( ) . unwrap ( ) ;
138+
139+ // NOTE: ignore routes like "multicast ff00::/8 dev eth1 metric 256"
140+ if dst_str == "multicast" {
141+ // dst_str = split.next().unwrap();
142+ continue ;
143+ }
144+
138145 if dst_str == "default" {
139146 dst_str = if is_ipv6 { "::/0" } else { "0.0.0.0/0" }
140147 }
@@ -146,7 +153,7 @@ fn route_show(is_ipv6: bool) -> std::io::Result<Vec<(IpCidr, Vec<String>)>> {
146153
147154 let cidr: IpCidr = create_cidr ( IpAddr :: from_str ( addr_str) . unwrap ( ) , u8:: from_str ( prefix_len_str) . unwrap ( ) ) ?;
148155 let route_components: Vec < String > = split. map ( String :: from) . collect ( ) ;
149- route_info. push ( ( cidr, route_components) )
156+ route_info. push ( ( cidr, route_components) ) ;
150157 }
151158 Ok ( route_info)
152159}
You can’t perform that action at this time.
0 commit comments