Skip to content

Commit

Permalink
Merge pull request #23 from bigio/ipv6_mapped
Browse files Browse the repository at this point in the history
do not try to parse an ip4 address as an ipv6 address
  • Loading branch information
marcbradshaw authored Aug 26, 2024
2 parents 8cd8323 + 12d9539 commit 7864a33
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 7864a33

Please sign in to comment.