update IPv4 check and add IPv6 check in whitelist
Signed-off-by: Xerxes-2 <dspxue@gmail.com>
This commit is contained in:
parent
cf721e9bb3
commit
de951ad70a
3 changed files with 8 additions and 7 deletions
|
|
@ -632,10 +632,7 @@ impl Connection {
|
|||
.is_none()
|
||||
&& whitelist
|
||||
.iter()
|
||||
.filter(|x| match IpCidr::from_str(x) {
|
||||
Ok(cidr) => cidr.contains(addr.ip()),
|
||||
Err(_) => false,
|
||||
})
|
||||
.filter(|x| IpCidr::from_str(x).map_or(false, |y| y.contains(addr.ip())))
|
||||
.next()
|
||||
.is_none()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue