* [PATCH v4 2/5] netconfig: Request all known IPv6 addresses
2019-10-01 23:44 [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
@ 2019-10-01 23:44 ` Tim Kourt
2019-10-01 23:44 ` [PATCH v4 3/5] netconfig: Add IPv6 static address installation/removal Tim Kourt
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Tim Kourt @ 2019-10-01 23:44 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]
---
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))
--
2.13.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v4 3/5] netconfig: Add IPv6 static address installation/removal
2019-10-01 23:44 [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
2019-10-01 23:44 ` [PATCH v4 2/5] netconfig: Request all known IPv6 addresses Tim Kourt
@ 2019-10-01 23:44 ` Tim Kourt
2019-10-02 17:08 ` Denis Kenzior
2019-10-01 23:44 ` [PATCH v4 4/5] netconfig: Install IPv6 default route Tim Kourt
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Tim Kourt @ 2019-10-01 23:44 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 6891 bytes --]
The network configuration options for IPv6 are grouped under [IPv6]
and include the following:
ip= ADDRESS/PREFIX
gateway=ADDRESS
dns=ADDRESS
The placeholders for DHCPv6 are placed along the way and marked
as TODO items.
---
src/netconfig.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 152 insertions(+), 8 deletions(-)
diff --git a/src/netconfig.c b/src/netconfig.c
index 7d1f5509..7d26acb0 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -48,6 +48,7 @@ struct netconfig {
struct l_dhcp_client *dhcp_client;
struct l_queue *ifaddr_list;
uint8_t rtm_protocol;
+ uint8_t rtm_v6_protocol;
const struct l_settings *active_settings;
};
@@ -224,6 +225,70 @@ static char **netconfig_ipv4_get_dns(struct netconfig *netconfig, uint8_t proto)
return NULL;
}
+static struct netconfig_ifaddr *netconfig_ipv6_get_ifaddr(
+ struct netconfig *netconfig,
+ uint8_t proto)
+{
+ struct in6_addr in6_addr;
+ struct netconfig_ifaddr *ifaddr;
+ char *ip;
+ char *p;
+
+ switch (proto) {
+ case RTPROT_STATIC:
+ if (!netconfig->active_settings)
+ return NULL;
+
+ ip = l_settings_get_string(netconfig->active_settings, "IPv6",
+ "ip");
+ if (!ip)
+ return NULL;
+
+ ifaddr = l_new(struct netconfig_ifaddr, 1);
+ ifaddr->ip = ip;
+
+ p = strrchr(ifaddr->ip, '/');
+ if (!p)
+ goto no_prefix_len;
+
+ *p = '\0';
+
+ if (inet_pton(AF_INET6, ifaddr->ip, &in6_addr) < 1) {
+ l_error("netconfig: Invalid IPv6 address %s is "
+ "provided in network configuration file.",
+ ifaddr->ip);
+
+ netconfig_ifaddr_destroy(ifaddr);
+
+ return NULL;
+ }
+
+ if (*++p == '\0')
+ goto no_prefix_len;
+
+ ifaddr->prefix_len = strtoul(p, NULL, 10);
+
+ if (!unlikely(errno == EINVAL || errno == ERANGE ||
+ !ifaddr->prefix_len ||
+ ifaddr->prefix_len > 128))
+ goto proceed;
+
+no_prefix_len:
+ ifaddr->prefix_len = 128;
+proceed:
+ ifaddr->family = AF_INET6;
+
+ return ifaddr;
+
+ case RTPROT_DHCP:
+ /* TODO */
+
+ return NULL;
+ }
+
+ return NULL;
+}
+
static bool netconfig_ifaddr_match(const void *a, const void *b)
{
const struct netconfig_ifaddr *entry = a;
@@ -541,6 +606,19 @@ done:
netconfig_ifaddr_destroy(ifaddr);
}
+static void netconfig_ipv6_ifaddr_add_cmd_cb(int error, uint16_t type,
+ const void *data, uint32_t len,
+ void *user_data)
+{
+ if (error && error != -EEXIST) {
+ l_error("netconfig: Failed to add IPv6 address. "
+ "Error %d: %s", error, strerror(-error));
+ return;
+ }
+
+ /* TODO Install routes and DNS */
+}
+
static void netconfig_install_address(struct netconfig *netconfig,
struct netconfig_ifaddr *ifaddr)
{
@@ -560,6 +638,16 @@ static void netconfig_install_address(struct netconfig *netconfig,
l_error("netconfig: Failed to set IP %s/%u.", ifaddr->ip,
ifaddr->prefix_len);
break;
+ case AF_INET6:
+ if (rtnl_ifaddr_ipv6_add(rtnl, netconfig->ifindex,
+ ifaddr->prefix_len, ifaddr->ip,
+ netconfig_ipv6_ifaddr_add_cmd_cb,
+ netconfig, NULL))
+ return;
+
+ l_error("netconfig: Failed to set IPv6 address %s/%u.",
+ ifaddr->ip, ifaddr->prefix_len);
+ break;
default:
l_error("netconfig: Unsupported address family: %u",
ifaddr->family);
@@ -606,6 +694,16 @@ static void netconfig_uninstall_address(struct netconfig *netconfig,
l_error("netconfig: Failed to delete IP %s/%u.",
ifaddr->ip, ifaddr->prefix_len);
break;
+ case AF_INET6:
+ if (rtnl_ifaddr_ipv6_delete(rtnl, netconfig->ifindex,
+ ifaddr->prefix_len, ifaddr->ip,
+ netconfig_ifaddr_del_cmd_cb, netconfig,
+ NULL))
+ return;
+
+ l_error("netconfig: Failed to delete IPv6 address %s/%u.",
+ ifaddr->ip, ifaddr->prefix_len);
+ break;
default:
l_error("netconfig: Unsupported address family: %u",
ifaddr->family);
@@ -717,6 +815,49 @@ static void netconfig_ipv4_select_and_uninstall(struct netconfig *netconfig)
l_dhcp_client_stop(netconfig->dhcp_client);
}
+static void netconfig_ipv6_select_and_install(struct netconfig *netconfig)
+{
+ struct netconfig_ifaddr *ifaddr;
+
+ ifaddr = netconfig_ipv6_get_ifaddr(netconfig, RTPROT_STATIC);
+ if (ifaddr) {
+ netconfig->rtm_v6_protocol = RTPROT_STATIC;
+ netconfig_install_address(netconfig, ifaddr);
+ netconfig_ifaddr_destroy(ifaddr);
+
+ return;
+ }
+
+ /*
+ * TODO
+ *
+ * netconfig->rtm_v6_protocol = RTPROT_DHCP;
+ *
+ * if (l_dhcp_v6_client_start(netconfig->l_dhcp_v6_client))
+ * return;
+ *
+ * l_error("netconfig: Failed to start DHCPv6 client for "
+ * "interface %u", netconfig->ifindex);
+ */
+}
+
+static void netconfig_ipv6_select_and_uninstall(struct netconfig *netconfig)
+{
+ struct netconfig_ifaddr *ifaddr;
+
+ ifaddr = netconfig_ipv6_get_ifaddr(netconfig,
+ netconfig->rtm_v6_protocol);
+ if (ifaddr) {
+ netconfig_uninstall_address(netconfig, ifaddr);
+ netconfig_ifaddr_destroy(ifaddr);
+ }
+
+ /*
+ * TODO
+ * l_dhcp_v6_client_stop(netconfig->l_dhcp_v6_client);
+ */
+}
+
bool netconfig_configure(struct netconfig *netconfig,
const struct l_settings *active_settings,
const uint8_t *mac_address)
@@ -728,7 +869,7 @@ bool netconfig_configure(struct netconfig *netconfig,
netconfig_ipv4_select_and_install(netconfig);
- /* TODO: IPv6 addressing */
+ netconfig_ipv6_select_and_install(netconfig);
return true;
}
@@ -739,7 +880,9 @@ bool netconfig_reconfigure(struct netconfig *netconfig)
/* TODO l_dhcp_client sending a DHCP inform request */
}
- /* TODO: IPv6 addressing */
+ if (netconfig->rtm_v6_protocol == RTPROT_DHCP) {
+ /* TODO l_dhcp_v6_client sending a DHCP inform request */
+ }
return true;
}
@@ -747,13 +890,13 @@ bool netconfig_reconfigure(struct netconfig *netconfig)
bool netconfig_reset(struct netconfig *netconfig)
{
netconfig_ipv4_select_and_uninstall(netconfig);
+ netconfig->rtm_protocol = 0;
- /* TODO: IPv6 addressing */
+ netconfig_ipv6_select_and_uninstall(netconfig);
+ netconfig->rtm_v6_protocol = 0;
resolve_remove(netconfig->ifindex);
- netconfig->rtm_protocol = 0;
-
return true;
}
@@ -790,13 +933,14 @@ void netconfig_destroy(struct netconfig *netconfig)
l_queue_remove(netconfig_list, netconfig);
- if (netconfig->rtm_protocol) {
+ if (netconfig->rtm_protocol)
netconfig_ipv4_select_and_uninstall(netconfig);
- /* TODO Uninstall IPv6 addresses. */
+ if (netconfig->rtm_v6_protocol)
+ netconfig_ipv6_select_and_uninstall(netconfig);
+ if (netconfig->rtm_protocol || netconfig->rtm_v6_protocol)
resolve_remove(netconfig->ifindex);
- }
netconfig_free(netconfig);
}
--
2.13.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 3/5] netconfig: Add IPv6 static address installation/removal
2019-10-01 23:44 ` [PATCH v4 3/5] netconfig: Add IPv6 static address installation/removal Tim Kourt
@ 2019-10-02 17:08 ` Denis Kenzior
0 siblings, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2019-10-02 17:08 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]
Hi Tim,
On 10/1/19 6:44 PM, Tim Kourt wrote:
> The network configuration options for IPv6 are grouped under [IPv6]
> and include the following: ip= ADDRESS/PREFIX gateway=ADDRESS
> dns=ADDRESS
>
> The placeholders for DHCPv6 are placed along the way and marked as
> TODO items. --- src/netconfig.c | 160
> +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file
> changed, 152 insertions(+), 8 deletions(-)
>
<snip>
> @@ -224,6 +225,70 @@ static char **netconfig_ipv4_get_dns(struct
> netconfig *netconfig, uint8_t proto) return NULL; }
>
> +static struct netconfig_ifaddr *netconfig_ipv6_get_ifaddr( +
> struct netconfig *netconfig, + uint8_t proto) +{ + struct
> in6_addr in6_addr; + struct netconfig_ifaddr *ifaddr; + char *ip; +
> char *p; + + switch (proto) { + case RTPROT_STATIC: + if
> (!netconfig->active_settings) + return NULL; + + ip =
> l_settings_get_string(netconfig->active_settings, "IPv6", +
> "ip"); + if (!ip) + return NULL; + + ifaddr = l_new(struct
> netconfig_ifaddr, 1); + ifaddr->ip = ip; + + p =
> strrchr(ifaddr->ip, '/'); + if (!p) + goto no_prefix_len; + + *p
> = '\0'; + + if (inet_pton(AF_INET6, ifaddr->ip, &in6_addr) < 1) { +
> l_error("netconfig: Invalid IPv6 address %s is " + "provided in
> network configuration file.", + ifaddr->ip); + +
> netconfig_ifaddr_destroy(ifaddr); + + return NULL; + } + + if
> (*++p == '\0') + goto no_prefix_len; + + ifaddr->prefix_len =
> strtoul(p, NULL, 10); + + if (!unlikely(errno == EINVAL || errno ==
> ERANGE || + !ifaddr->prefix_len || + ifaddr->prefix_len >
> 128)) + goto proceed; + +no_prefix_len: + ifaddr->prefix_len =
> 128; +proceed: + ifaddr->family = AF_INET6; +
Didn't we agree to perform the validation in netconfig_configure?
> + return ifaddr; + + case RTPROT_DHCP: + /* TODO */ + + return
> NULL; + } + + return NULL; +} + static bool
> netconfig_ifaddr_match(const void *a, const void *b) { const struct
> netconfig_ifaddr *entry = a;
<snip>
> @@ -747,13 +890,13 @@ bool netconfig_reconfigure(struct netconfig
> *netconfig) bool netconfig_reset(struct netconfig *netconfig) {
> netconfig_ipv4_select_and_uninstall(netconfig); +
> netconfig->rtm_protocol = 0;
>
> - /* TODO: IPv6 addressing */ +
> netconfig_ipv6_select_and_uninstall(netconfig); +
> netconfig->rtm_v6_protocol = 0;
>
> resolve_remove(netconfig->ifindex);
>
> - netconfig->rtm_protocol = 0; - return true; }
>
> @@ -790,13 +933,14 @@ void netconfig_destroy(struct netconfig
> *netconfig)
>
> l_queue_remove(netconfig_list, netconfig);
>
> - if (netconfig->rtm_protocol) { + if (netconfig->rtm_protocol)
> netconfig_ipv4_select_and_uninstall(netconfig);
>
> - /* TODO Uninstall IPv6 addresses. */ + if
> (netconfig->rtm_v6_protocol) +
> netconfig_ipv6_select_and_uninstall(netconfig);
>
> + if (netconfig->rtm_protocol || netconfig->rtm_v6_protocol)
> resolve_remove(netconfig->ifindex); - }
Shouldn't you implement netconfig_destroy using netconfig_reset? Since
they perform nearly identical set of operations?
>
> netconfig_free(netconfig); }
>
Anyway, I'll just take this patch, but please fix these.
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 4/5] netconfig: Install IPv6 default route
2019-10-01 23:44 [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
2019-10-01 23:44 ` [PATCH v4 2/5] netconfig: Request all known IPv6 addresses Tim Kourt
2019-10-01 23:44 ` [PATCH v4 3/5] netconfig: Add IPv6 static address installation/removal Tim Kourt
@ 2019-10-01 23:44 ` Tim Kourt
2019-10-02 17:12 ` Denis Kenzior
2019-10-01 23:44 ` [PATCH v4 5/5] netconfig: Install IPv6 DNS Tim Kourt
2019-10-02 17:03 ` [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Denis Kenzior
4 siblings, 1 reply; 9+ messages in thread
From: Tim Kourt @ 2019-10-01 23:44 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 2535 bytes --]
---
src/netconfig.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
diff --git a/src/netconfig.c b/src/netconfig.c
index 7d26acb0..129fe518 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -289,6 +289,40 @@ proceed:
return NULL;
}
+static char *netconfig_ipv6_get_gateway(struct netconfig *netconfig)
+{
+ struct in6_addr in6_addr;
+ char *gateway;
+
+ switch (netconfig->rtm_v6_protocol) {
+ case RTPROT_STATIC:
+ if (!netconfig->active_settings)
+ return NULL;
+
+ gateway = l_settings_get_string(netconfig->active_settings,
+ "IPv6", "gateway");
+
+ if (inet_pton(AF_INET6, gateway, &in6_addr) < 1) {
+ l_error("netconfig: Invalid IPv6 gateway address %s is "
+ "provided in network configuration file.",
+ gateway);
+
+ l_free(gateway);
+
+ return NULL;
+ }
+
+ return gateway;
+
+ case RTPROT_DHCP:
+ /* TODO */
+
+ return NULL;
+ }
+
+ return NULL;
+}
+
static bool netconfig_ifaddr_match(const void *a, const void *b)
{
const struct netconfig_ifaddr *entry = a;
@@ -606,17 +640,52 @@ done:
netconfig_ifaddr_destroy(ifaddr);
}
+static bool netconfig_ipv6_routes_install(struct netconfig *netconfig)
+{
+ L_AUTO_FREE_VAR(char *, gateway) = NULL;
+
+ gateway = netconfig_ipv6_get_gateway(netconfig);
+ if (!gateway) {
+ l_error("netconfig: Failed to obtain gateway from %s.",
+ netconfig->rtm_v6_protocol == RTPROT_STATIC ?
+ "settings file" : "DHCPv6 lease");
+
+ return false;
+ }
+
+ if (!rtnl_route_ipv6_add_gateway(rtnl, netconfig->ifindex, gateway,
+ ROUTE_PRIORITY_OFFSET,
+ netconfig->rtm_v6_protocol,
+ netconfig_route_cmd_cb,
+ NULL, NULL)) {
+ l_error("netconfig: Failed to add route for: %s gateway.",
+ gateway);
+
+ return false;
+ }
+
+ return true;
+}
+
static void netconfig_ipv6_ifaddr_add_cmd_cb(int error, uint16_t type,
const void *data, uint32_t len,
void *user_data)
{
+ struct netconfig *netconfig = user_data;
+
if (error && error != -EEXIST) {
l_error("netconfig: Failed to add IPv6 address. "
"Error %d: %s", error, strerror(-error));
return;
}
- /* TODO Install routes and DNS */
+ if (!netconfig_ipv6_routes_install(netconfig)) {
+ l_error("netconfig: Failed to install IPv6 routes.");
+
+ return;
+ }
+
+ /* TODO Install DNS */
}
static void netconfig_install_address(struct netconfig *netconfig,
--
2.13.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 4/5] netconfig: Install IPv6 default route
2019-10-01 23:44 ` [PATCH v4 4/5] netconfig: Install IPv6 default route Tim Kourt
@ 2019-10-02 17:12 ` Denis Kenzior
0 siblings, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2019-10-02 17:12 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 926 bytes --]
Hi Tim,
On 10/1/19 6:44 PM, Tim Kourt wrote:
> ---
> src/netconfig.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 70 insertions(+), 1 deletion(-)
>
> diff --git a/src/netconfig.c b/src/netconfig.c
> index 7d26acb0..129fe518 100644
> --- a/src/netconfig.c
> +++ b/src/netconfig.c
> @@ -289,6 +289,40 @@ proceed:
> return NULL;
> }
>
> +static char *netconfig_ipv6_get_gateway(struct netconfig *netconfig)
> +{
> + struct in6_addr in6_addr;
> + char *gateway;
> +
> + switch (netconfig->rtm_v6_protocol) {
> + case RTPROT_STATIC:
> + if (!netconfig->active_settings)
> + return NULL;
> +
I took out this check. active_settings should never be NULL, so thee
principle of crash early applies. Also, since we're moving validation
to _configure eventually, the need for this check is even less justifiable.
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 5/5] netconfig: Install IPv6 DNS
2019-10-01 23:44 [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
` (2 preceding siblings ...)
2019-10-01 23:44 ` [PATCH v4 4/5] netconfig: Install IPv6 default route Tim Kourt
@ 2019-10-01 23:44 ` Tim Kourt
2019-10-02 17:14 ` Denis Kenzior
2019-10-02 17:03 ` [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Denis Kenzior
4 siblings, 1 reply; 9+ messages in thread
From: Tim Kourt @ 2019-10-01 23:44 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]
---
src/netconfig.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/src/netconfig.c b/src/netconfig.c
index 129fe518..65ba5330 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -323,6 +323,50 @@ static char *netconfig_ipv6_get_gateway(struct netconfig *netconfig)
return NULL;
}
+static char **netconfig_ipv6_get_dns(struct netconfig *netconfig, uint8_t proto)
+{
+ struct in6_addr in6_addr;
+ char **dns_list;
+ char **p;
+
+ switch (proto) {
+ case RTPROT_STATIC:
+ if (!netconfig->active_settings)
+ return NULL;
+
+ p = dns_list =
+ l_settings_get_string_list(netconfig->active_settings,
+ "IPv6", "dns", ' ');
+
+ if (!dns_list || !*dns_list) {
+ l_strv_free(dns_list);
+
+ return NULL;
+ }
+
+ for (; *p; p++) {
+ if (inet_pton(AF_INET6, *p, &in6_addr) == 1)
+ continue;
+
+ l_error("netconfig: Invalid IPv6 DNS address %s is "
+ "provided in network configuration file.", *p);
+
+ l_strv_free(dns_list);
+
+ return NULL;
+ }
+
+ return dns_list;
+
+ case RTPROT_DHCP:
+ /* TODO */
+
+ return NULL;
+ }
+
+ return NULL;
+}
+
static bool netconfig_ifaddr_match(const void *a, const void *b)
{
const struct netconfig_ifaddr *entry = a;
@@ -672,6 +716,7 @@ static void netconfig_ipv6_ifaddr_add_cmd_cb(int error, uint16_t type,
void *user_data)
{
struct netconfig *netconfig = user_data;
+ char **dns;
if (error && error != -EEXIST) {
l_error("netconfig: Failed to add IPv6 address. "
@@ -685,7 +730,16 @@ static void netconfig_ipv6_ifaddr_add_cmd_cb(int error, uint16_t type,
return;
}
- /* TODO Install DNS */
+ dns = netconfig_ipv6_get_dns(netconfig, netconfig->rtm_v6_protocol);
+ if (!dns) {
+ l_error("netconfig: Failed to obtain the DNS addresses from "
+ "%s.", netconfig->rtm_v6_protocol == RTPROT_STATIC ?
+ "setting file" : "DHCPv6 lease");
+ return;
+ }
+
+ resolve_add_dns(netconfig->ifindex, AF_INET6, dns);
+ l_strv_free(dns);
}
static void netconfig_install_address(struct netconfig *netconfig,
--
2.13.6
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 5/5] netconfig: Install IPv6 DNS
2019-10-01 23:44 ` [PATCH v4 5/5] netconfig: Install IPv6 DNS Tim Kourt
@ 2019-10-02 17:14 ` Denis Kenzior
0 siblings, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2019-10-02 17:14 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
Hi Tim,
On 10/1/19 6:44 PM, Tim Kourt wrote:
> ---
> src/netconfig.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 55 insertions(+), 1 deletion(-)
>
> diff --git a/src/netconfig.c b/src/netconfig.c
> index 129fe518..65ba5330 100644
> --- a/src/netconfig.c
> +++ b/src/netconfig.c
> @@ -323,6 +323,50 @@ static char *netconfig_ipv6_get_gateway(struct netconfig *netconfig)
> return NULL;
> }
>
> +static char **netconfig_ipv6_get_dns(struct netconfig *netconfig, uint8_t proto)
> +{
> + struct in6_addr in6_addr;
> + char **dns_list;
> + char **p;
> +
> + switch (proto) {
> + case RTPROT_STATIC:
> + if (!netconfig->active_settings)
> + return NULL;
> +
Took out this check, same reasoning as the previous commit.
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes
2019-10-01 23:44 [PATCH v4 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
` (3 preceding siblings ...)
2019-10-01 23:44 ` [PATCH v4 5/5] netconfig: Install IPv6 DNS Tim Kourt
@ 2019-10-02 17:03 ` Denis Kenzior
4 siblings, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2019-10-02 17:03 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 295 bytes --]
Hi Tim,
On 10/1/19 6:44 PM, Tim Kourt wrote:
> The IPv6 addresses changes are maintained in ifaddr_list.
> ---
> src/netconfig.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
>
Patch 1 & 2 applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread