From 0a293ef538b2bfb7bfbcd08379d48102d1fdb3cb Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Tue, 1 Oct 2019 16:44:22 -0700 Subject: [PATCH] netconfig: Request all known IPv6 addresses --- src/netconfig.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/netconfig.c b/src/netconfig.c index 1c8b88dc..7d1f5509 100644 --- a/src/netconfig.c +++ b/src/netconfig.c @@ -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, const void *data, uint32_t len, void *user_data) @@ -832,6 +848,14 @@ static int netconfig_init(void) 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", "route_priority_offset", &ROUTE_PRIORITY_OFFSET))