summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-04-24 16:40:41 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-04-24 16:21:41 +0200
commit1c249af7946667f24cd2b995cc13149b77dd62df (patch)
treeacfb81f855260ff6278c6d0be830630f7f7fed53 /src/rtnl.c
parent51f6e0a79fffaea92d044a2b541da316bd57ffcd (diff)
downloadconnman-1c249af7946667f24cd2b995cc13149b77dd62df.tar.gz
connman-1c249af7946667f24cd2b995cc13149b77dd62df.tar.bz2
connman-1c249af7946667f24cd2b995cc13149b77dd62df.zip
resolver: Use proper IPv6 source address when sending DNS queries
This fix is for following scenario: - New interface is coming up. - There is radvd in the connected network and it is advertising IPv6 addresses and DNS servers. - Kernel receives router advertisement and picks up the DNS server information which is then routed via netlink to rtnl.c:rtnl_newnduseropt() which then creates DNS listener. - Kernel activates DAD (duplicate address detection). - As the DAD takes some time we now have interface up and it only has link local IPv6 address defined. - The DNS listener is now using link local source addresses when sending queries instead of proper autoconfigured addresses. - When DAD is finished, the interface will have autoconfigured addresses assigned and corresponding netlink message will cause function rtnl.c:process_newaddr() to be called. - If all this happens, then we re-create DNS listener in dnsproxy.c so that listener will have a proper (autoconfigured) source address when sending DNS packets.
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index 39afb12b..251d9cd9 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -601,6 +601,20 @@ static void process_newaddr(unsigned char family, unsigned char prefixlen,
__connman_ipconfig_newaddr(index, family, label,
prefixlen, ip_string);
+
+ if (family == AF_INET6) {
+ /*
+ * Re-create RDNSS configured servers if there are any
+ * for this interface. This is done because we might
+ * have now properly configured interface with proper
+ * autoconfigured address.
+ */
+ char *interface = connman_inet_ifname(index);
+
+ __connman_resolver_redo_servers(interface);
+
+ g_free(interface);
+ }
}
static void process_deladdr(unsigned char family, unsigned char prefixlen,