kernel-netlink: Enumerate temporary IPv6 addresses according to config
This way we announce only permanent addresses via MOBIKE by default, and temporary ones if the option is enabled.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2018 Tobias Brunner
|
||||
* Copyright (C) 2008-2019 Tobias Brunner
|
||||
* Copyright (C) 2005-2008 Martin Willi
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
@@ -1608,6 +1608,14 @@ CALLBACK(filter_addresses, bool,
|
||||
{ /* skip deprecated addresses or those with an unusable scope */
|
||||
continue;
|
||||
}
|
||||
if (addr->ip->get_family(addr->ip) == AF_INET6)
|
||||
{ /* handle temporary IPv6 addresses according to config */
|
||||
bool temporary = (addr->flags & IFA_F_TEMPORARY) == IFA_F_TEMPORARY;
|
||||
if (data->this->prefer_temporary_addrs != temporary)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
*out = addr->ip;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user