summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-11 10:45:24 +0200
committerThomas Haller <thaller@redhat.com>2016-04-11 11:13:17 +0200
commitc328cf52f2b219feb5ae03fd40175f6b6ca73975 (patch)
treebea8b7ca8a5ebae1c2585996d38b7ed335a35798
parentadb534518b41bf400c38a714fdb62f0e7784b116 (diff)
dnsmasq: fix using '%' delimiter to scope link local with zone-id
Since long, dnsmasq supports scoping the IPv6 address with '@<interface-name>'. Since 2.58, it also supports '%' as delimiter, which is the standard way to specify the zone-id (rfc6874). Since 2.73, specifying the scope with '@' as "server" address is no longer working properly, thus breaking NetworkManager with dnsmasq >= 2.73. To work around that, use '%' delimiter. That breaks pre-2.58 users that have a DNS server on a link local address, but that seems acceptable as that version was released in January 2012. https://bugzilla.gnome.org/show_bug.cgi?id=764839
-rw-r--r--src/dns-manager/nm-dns-dnsmasq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dns-manager/nm-dns-dnsmasq.c b/src/dns-manager/nm-dns-dnsmasq.c
index 460feaaccb..5ead5ecf3b 100644
--- a/src/dns-manager/nm-dns-dnsmasq.c
+++ b/src/dns-manager/nm-dns-dnsmasq.c
@@ -131,18 +131,18 @@ ip6_addr_to_string (const struct in6_addr *addr, const char *iface)
char *buf;
if (IN6_IS_ADDR_V4MAPPED (addr)) {
- /* inet_ntop is probably supposed to do this for us, but it doesn't */
buf = g_malloc (INET_ADDRSTRLEN);
nm_utils_inet4_ntop (addr->s6_addr32[3], buf);
} else if (!iface || !iface[0] || !IN6_IS_ADDR_LINKLOCAL (addr)) {
buf = g_malloc (INET6_ADDRSTRLEN);
nm_utils_inet6_ntop (addr, buf);
} else {
- /* If we got a scope identifier, we need use '%' instead of
- * '@', since dnsmasq supports '%' in server= addresses
- * only since version 2.58 and up
+ /* Need to scope the address with %<zone-id>. Before dnsmasq 2.58,
+ * only '@' was supported as delimiter. Since 2.58, '@' and '%'
+ * are supported. Due to a bug, since 2.73 only '%' works properly
+ * as "server" address.
*/
- buf = g_strconcat (nm_utils_inet6_ntop (addr, NULL), "@", iface, NULL);
+ buf = g_strconcat (nm_utils_inet6_ntop (addr, NULL), "%", iface, NULL);
}
return buf;
}