summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-10 22:17:03 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-11 15:23:44 +0200
commit41842d3f91733786cb4d2bcdc6ca0c3a1a1c594b (patch)
treeac120ef2e43cc60b18a81ea9fbf5f6f1e60c8f54 /interface.c
parent34a1a4bad31ba6f138cd6a98249c774ff66285d1 (diff)
add some code for keeping track of dns servers and search domains and for writing resolv.conf
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/interface.c b/interface.c
index 17cb754..37b20cc 100644
--- a/interface.c
+++ b/interface.c
@@ -185,6 +185,7 @@ interface_claim_device(struct interface *iface)
static void
interface_cleanup(struct interface *iface)
{
+ interface_clear_dns(iface);
interface_clear_errors(iface);
if (iface->main_dev.dev)
device_remove_user(&iface->main_dev);
@@ -241,6 +242,7 @@ interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
iface->state = IFS_UP;
iface->start_time = system_get_rtime();
interface_event(iface, IFEV_UP);
+ interface_write_resolv_conf();
break;
case IFPEV_DOWN:
if (iface->state == IFS_DOWN)
@@ -285,6 +287,8 @@ interface_init(struct interface *iface, const char *name,
strncpy(iface->name, name, sizeof(iface->name) - 1);
INIT_LIST_HEAD(&iface->errors);
INIT_LIST_HEAD(&iface->hotplug_list);
+ INIT_LIST_HEAD(&iface->proto_dns_search);
+ INIT_LIST_HEAD(&iface->proto_dns_servers);
iface->main_dev.cb = interface_cb;
iface->l3_dev = &iface->main_dev;