The name server refresh should be only done for IPv6
nameservers.
#include <string.h>
#include <sys/stat.h>
#include <resolv.h>
+#include <netdb.h>
#include "connman.h"
char *interface;
char *domain;
char *server;
+ int family;
unsigned int flags;
unsigned int lifetime;
guint timeout;
entry->server = g_strdup(server);
entry->flags = flags;
entry->lifetime = lifetime;
+
+ if (server != NULL)
+ entry->family = connman_inet_check_ipaddress(server);
+
if (lifetime) {
int index;
interval = lifetime * RESOLVER_LIFETIME_REFRESH_THRESHOLD;
continue;
/*
+ * This function must only check IPv6 server addresses so
+ * do not remove IPv4 name servers unnecessarily.
+ */
+ if (entry->family != AF_INET6)
+ continue;
+
+ /*
* We remove the server, and then re-create so that it will
* use proper source addresses when sending DNS queries.
*/