projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
if an interface is brought down by the proto handler and autostart is still active...
[project/netifd.git]
/
interface.c
diff --git
a/interface.c
b/interface.c
index
b8b3fd1
..
514b4d5
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-9,6
+9,7
@@
#include "proto.h"
#include "ubus.h"
#include "config.h"
#include "proto.h"
#include "ubus.h"
#include "config.h"
+#include "system.h"
struct vlist_tree interfaces;
struct vlist_tree interfaces;
@@
-78,7
+79,7
@@
void interface_add_error(struct interface *iface, const char *subsystem,
static void
interface_event(struct interface *iface, enum interface_event ev)
{
static void
interface_event(struct interface *iface, enum interface_event ev)
{
- /* TODO */
+ interface_queue_event(iface, ev);
}
static void
}
static void
@@
-184,6
+185,7
@@
interface_claim_device(struct interface *iface)
static void
interface_cleanup(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);
interface_clear_errors(iface);
if (iface->main_dev.dev)
device_remove_user(&iface->main_dev);
@@
-196,6
+198,7
@@
interface_do_free(struct interface *iface)
interface_cleanup(iface);
free(iface->config);
netifd_ubus_remove_interface(iface);
interface_cleanup(iface);
free(iface->config);
netifd_ubus_remove_interface(iface);
+ avl_delete(&interfaces.avl, &iface->node.avl);
free(iface);
}
free(iface);
}
@@
-237,7
+240,9
@@
interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
return;
iface->state = IFS_UP;
return;
iface->state = IFS_UP;
+ iface->start_time = system_get_rtime();
interface_event(iface, IFEV_UP);
interface_event(iface, IFEV_UP);
+ interface_write_resolv_conf();
break;
case IFPEV_DOWN:
if (iface->state == IFS_DOWN)
break;
case IFPEV_DOWN:
if (iface->state == IFS_DOWN)
@@
-245,6
+250,8
@@
interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
mark_interface_down(iface);
interface_handle_config_change(iface);
mark_interface_down(iface);
interface_handle_config_change(iface);
+ if (iface->autostart)
+ __interface_set_up(iface);
break;
case IFPEV_LINK_LOST:
if (iface->state != IFS_UP)
break;
case IFPEV_LINK_LOST:
if (iface->state != IFS_UP)
@@
-281,6
+288,9
@@
interface_init(struct interface *iface, const char *name,
strncpy(iface->name, name, sizeof(iface->name) - 1);
INIT_LIST_HEAD(&iface->errors);
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;
iface->main_dev.cb = interface_cb;
iface->l3_dev = &iface->main_dev;