mirror of
https://github.com/toreanderson/clatd
synced 2026-03-11 00:04:52 +00:00
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:
5
clatd
5
clatd
@@ -471,6 +471,11 @@ sub get_clat_v6_addr {
|
|||||||
close($fd)
|
close($fd)
|
||||||
or err("'ip -6 address list scope global dev $plat_dev' failed");
|
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
|
# First clear the middle 0xfffe bits of the interface ID
|
||||||
my $mask = Net::IP->new("ffff:ffff:ffff:ffff:ffff:ff00:00ff:ffff");
|
my $mask = Net::IP->new("ffff:ffff:ffff:ffff:ffff:ff00:00ff:ffff");
|
||||||
$mask = $mask->intip();
|
$mask = $mask->intip();
|
||||||
|
|||||||
Reference in New Issue
Block a user