- list_for_each_entry_safe(route, tmp, &iface->routes, list)
- interface_del_route(iface, route);
+ fprintf(f, "nameserver %s\n", str);
+ }
+
+ list_for_each_entry(d, &iface->proto_dns_search, list) {
+ fprintf(f, "search %s\n", d->name);
+ }
+ }
+ fclose(f);
+ if (rename(path, resolv_conf) < 0) {
+ D(INTERFACE, "Failed to replace %s\n", resolv_conf);
+ unlink(path);
+ }
+}
+
+void
+interface_ip_update_start(struct interface *iface)
+{
+ interface_clear_dns(iface);
+ vlist_update(&iface->proto_route);
+ vlist_update(&iface->proto_addr);
+}
+
+void
+interface_ip_update_complete(struct interface *iface)
+{
+ vlist_flush(&iface->proto_route);
+ vlist_flush(&iface->proto_addr);
+}
+
+void
+interface_ip_init(struct interface *iface)
+{
+ vlist_init(&iface->proto_route, route_cmp, interface_update_proto_route,
+ struct device_route, node, mask);
+ vlist_init(&iface->proto_addr, addr_cmp, interface_update_proto_addr,
+ struct device_addr, node, mask);