From 6e0acecbacdb5bf1ce0b71d4c2512eae4606be57 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 3 Apr 2017 09:47:08 +0200 Subject: [PATCH] interface-ip: fix device name for IPv6 link-local DNS server 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 --- interface-ip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interface-ip.c b/interface-ip.c index dd4e01c..140ef34 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -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) -- 2.11.0