Skip to content

Commit e868594

Browse files
committedApr 14, 2024
fix: ip v4 filter typo and also clippy warnings
1 parent b6d11a6 commit e868594

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/filter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'a> IpFilters<'a> {
2323
macro_rules! non_broadcast {
2424
($addr:ident) => {
2525
match $addr {
26-
IpAddr::V4(a) => !(a.is_broadcast() || a.is_multicast() || a.is_multicast()),
26+
IpAddr::V4(a) => !(a.is_broadcast() || a.is_multicast() || a.is_unspecified()),
2727
IpAddr::V6(a) => !(a.is_multicast() || a.is_unspecified()),
2828
}
2929
};
@@ -47,7 +47,7 @@ impl<'a> IpFilters<'a> {
4747
}
4848

4949
pub fn add_all<I: IntoIterator<Item = IpFilter<'a>>>(&mut self, filters: I) {
50-
self.filters.extend(filters.into_iter());
50+
self.filters.extend(filters);
5151
}
5252

5353
pub fn is_allowed(&self, src: &IpAddr, dst: &IpAddr) -> bool {

0 commit comments

Comments
 (0)