Skip to content

Commit

Permalink
do not try to parse an ip4 address as an ipv6 address
Browse files Browse the repository at this point in the history
  • Loading branch information
bigio committed Sep 27, 2024
1 parent e194e7f commit cd48886
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Mail/SPF/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ sub ip_address_reverse {
or throw Mail::SPF::EInvalidOptionValue('NetAddr::IP IPv4 or IPv6 address expected');
try {
# Treat IPv4-mapped IPv6 addresses as IPv4 addresses:
$ip_address = $self->ipv6_address_to_ipv4($ip_address);
if($ip_address->version == 6) {
$ip_address = $self->ipv6_address_to_ipv4($ip_address);
}
}
catch Mail::SPF::EInvalidOptionValue with {};
# ...deliberately ignoring conversion errors.
Expand Down

0 comments on commit cd48886

Please sign in to comment.