interface-ip: fix device name for IPv6 link-local DNS server
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 3 Apr 2017 07:47:08 +0000 (09:47 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 5 Apr 2017 15:49:45 +0000 (17:49 +0200)
Commit 235a02424c3ab1b59308895c4f00395dacf2557c adds support for IPv6 link-local
DNS server by appending the device name; however the interface ifname parameter
does not always contain the layer 3 device name (e.g it can hold the aliased
interface name)
Fix this by passing the device name of the referenced layer 3 device.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-ip.c

index dd4e01c15b62757ebc0ca4411223a1b182173f89..140ef3441ea50fcf0d9a3dde71a7731e9e25f4e9 100644 (file)
@@ -1287,13 +1287,14 @@ __interface_write_dns_entries(FILE *f)
 
        avl_for_each_element(&resolv_conf_iface_entries, entry, node) {
                iface = (struct interface *)entry->node.key;
+               struct device *dev = iface->l3_dev.dev;
 
                fprintf(f, "# Interface %s\n", iface->name);
 
-               write_resolv_conf_entries(f, &iface->config_ip, iface->ifname);
+               write_resolv_conf_entries(f, &iface->config_ip, dev->ifname);
 
                if (!iface->proto_ip.no_dns)
-                       write_resolv_conf_entries(f, &iface->proto_ip, iface->ifname);
+                       write_resolv_conf_entries(f, &iface->proto_ip, dev->ifname);
        }
 
        avl_remove_all_elements(&resolv_conf_iface_entries, entry, node, n_entry)