Commit
+2 -2 +/-1 browse
1 | diff --git a/src/spf/verify.rs b/src/spf/verify.rs |
2 | index e85dd4c..7655943 100644 |
3 | --- a/src/spf/verify.rs |
4 | +++ b/src/spf/verify.rs |
5 | @@ -394,14 +394,14 @@ impl IpMask for IpAddr { |
6 | u32::from_be_bytes(match &self { |
7 | IpAddr::V4(ip) => ip.octets(), |
8 | IpAddr::V6(ip) => { |
9 | - if let Some(ip) = ip.to_ipv4() { |
10 | + if let Some(ip) = ip.to_ipv4_mapped() { |
11 | ip.octets() |
12 | } else { |
13 | return false; |
14 | } |
15 | } |
16 | }) & mask |
17 | - == u32::from_be_bytes(addr.octets()) |
18 | + == u32::from_be_bytes(addr.octets()) & mask |
19 | } |
20 | |
21 | fn matches_ipv6_mask(&self, addr: &Ipv6Addr, mask: u128) -> bool { |