use both is_ip_literal and IPAddress is_valid checks
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
9858b33b37
commit
1536f08d81
2 changed files with 6 additions and 2 deletions
|
@ -132,7 +132,9 @@ where
|
|||
));
|
||||
}
|
||||
|
||||
if destination.is_ip_literal() {
|
||||
// rust's built in <Ipv4Addr> parsing does not consider things like octal addresses valid
|
||||
// so we should check both just to be safe.
|
||||
if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) {
|
||||
info!(
|
||||
"Destination {} is an IP literal, checking against IP range denylist.",
|
||||
destination
|
||||
|
|
|
@ -717,7 +717,9 @@ impl Service {
|
|||
where
|
||||
T: Debug,
|
||||
{
|
||||
if destination.is_ip_literal() {
|
||||
// rust's built in <Ipv4Addr> parsing does not consider things like octal addresses valid
|
||||
// so we should check both just to be safe.
|
||||
if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) {
|
||||
info!(
|
||||
"Destination {} is an IP literal, checking against IP range denylist.",
|
||||
destination
|
||||
|
|
Loading…
Add table
Reference in a new issue