mirror of https://github.com/toreanderson/clatd
Avoid using a bogus CLAT address if no EUI-64
get_clat_v6_addr() didn't actually check if it saw any Modified EUI-64 based addresses on the PLAT device before proceeding. This caused it to return a bogus CLAT address (::c1:a700:0) instead of failing with a useful error message.
This commit is contained in:
parent
7e35aa56c7
commit
da7b48e779
5
clatd
5
clatd
|
|
@ -471,6 +471,11 @@ sub get_clat_v6_addr {
|
|||
close($fd)
|
||||
or err("'ip -6 address list scope global dev $plat_dev' failed");
|
||||
|
||||
if(!$ip) {
|
||||
err("No Modified EUI-64-based address seen on $plat_dev; clatd cannot ",
|
||||
"auto-generate a CLAT IPv6 address (try setting 'clat-v6-addr')");
|
||||
}
|
||||
|
||||
# First clear the middle 0xfffe bits of the interface ID
|
||||
my $mask = Net::IP->new("ffff:ffff:ffff:ffff:ffff:ff00:00ff:ffff");
|
||||
$mask = $mask->intip();
|
||||
|
|
|
|||
Loading…
Reference in New Issue