Skip to content

Commit ef5f9fc

Browse files
committed
multicast routes ignored
1 parent b231417 commit ef5f9fc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/linux.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)