[LEDE-DEV] [PATCH netifd] interface-ip: fix device name for IPv6 link-local DNS server

Hans Dedecker dedeckeh at gmail.com
Mon Apr 3 00:47:08 PDT 2017


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 at gmail.com>
---
 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)
-- 
1.9.1




More information about the Lede-dev mailing list