mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-10-05 19:08:52 +02:00
netconfig: Allow to override IPv6 DHCP DNSs with static addresses
This commit is contained in:
parent
0fdd27463e
commit
e0651cf25b
@ -345,23 +345,14 @@ static char **netconfig_ipv6_get_dns(struct netconfig *netconfig, uint8_t proto)
|
|||||||
char **dns_list;
|
char **dns_list;
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
switch (proto) {
|
p = dns_list = l_settings_get_string_list(netconfig->active_settings,
|
||||||
case RTPROT_STATIC:
|
|
||||||
p = dns_list =
|
|
||||||
l_settings_get_string_list(netconfig->active_settings,
|
|
||||||
"IPv6", "dns", ' ');
|
"IPv6", "dns", ' ');
|
||||||
|
if (dns_list && *dns_list) {
|
||||||
if (!dns_list || !*dns_list) {
|
|
||||||
l_strv_free(dns_list);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; *p; p++) {
|
for (; *p; p++) {
|
||||||
if (inet_pton(AF_INET6, *p, &in6_addr) == 1)
|
if (inet_pton(AF_INET6, *p, &in6_addr) == 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
l_error("netconfig: Invalid IPv6 DNS address %s is "
|
l_error("netconfig: Invalid IPv6 DNS address '%s' is "
|
||||||
"provided in network configuration file.", *p);
|
"provided in network configuration file.", *p);
|
||||||
|
|
||||||
l_strv_free(dns_list);
|
l_strv_free(dns_list);
|
||||||
@ -369,9 +360,18 @@ static char **netconfig_ipv6_get_dns(struct netconfig *netconfig, uint8_t proto)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Allow to override the DHCP DNSs with static addressing. */
|
||||||
return dns_list;
|
return dns_list;
|
||||||
|
} else if (dns_list) {
|
||||||
|
l_error("netconfig: No IPv6 DNS address is provided in network "
|
||||||
|
"configuration file.");
|
||||||
|
|
||||||
case RTPROT_DHCP:
|
l_strv_free(dns_list);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (proto == RTPROT_DHCP) {
|
||||||
/* TODO */
|
/* TODO */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user