3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

netconfig: Request all known IPv6 addresses

This commit is contained in:
Tim Kourt 2019-10-01 16:44:22 -07:00 committed by Denis Kenzior
parent 577e638be3
commit 0a293ef538

View File

@ -419,6 +419,22 @@ static void netconfig_ifaddr_ipv6_notify(uint16_t type, const void *data,
} }
} }
static void netconfig_ifaddr_ipv6_cmd_cb(int error, uint16_t type,
const void *data, uint32_t len,
void *user_data)
{
if (error) {
l_error("netconfig: ifaddr IPv6 command failure. "
"Error %d: %s", error, strerror(-error));
return;
}
if (type != RTM_NEWADDR)
return;
netconfig_ifaddr_ipv6_notify(type, data, len, user_data);
}
static void netconfig_route_cmd_cb(int error, uint16_t type, static void netconfig_route_cmd_cb(int error, uint16_t type,
const void *data, uint32_t len, const void *data, uint32_t len,
void *user_data) void *user_data)
@ -832,6 +848,14 @@ static int netconfig_init(void)
goto error; goto error;
} }
r = rtnl_ifaddr_ipv6_get(rtnl, netconfig_ifaddr_ipv6_cmd_cb, NULL,
NULL);
if (!r) {
l_error("netconfig: Failed to get IPv6 addresses from RTNL"
" link.");
goto error;
}
if (!l_settings_get_uint(iwd_get_config(), "General", if (!l_settings_get_uint(iwd_get_config(), "General",
"route_priority_offset", "route_priority_offset",
&ROUTE_PRIORITY_OFFSET)) &ROUTE_PRIORITY_OFFSET))