projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ubus: fix displaying interface data items
[project/netifd.git]
/
interface.c
diff --git
a/interface.c
b/interface.c
index
43ba773
..
4a3a725
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-222,11
+222,14
@@
mark_interface_down(struct interface *iface)
void
__interface_set_down(struct interface *iface, bool force)
{
void
__interface_set_down(struct interface *iface, bool force)
{
- switch (iface->state) {
+ enum interface_state state = iface->state;
+ switch (state) {
case IFS_UP:
case IFS_UP:
- interface_event(iface, IFEV_DOWN);
case IFS_SETUP:
iface->state = IFS_TEARDOWN;
case IFS_SETUP:
iface->state = IFS_TEARDOWN;
+ if (state == IFS_UP)
+ interface_event(iface, IFEV_DOWN);
+
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
if (force)
interface_flush_state(iface);
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
if (force)
interface_flush_state(iface);
@@
-270,7
+273,7
@@
interface_check_state(struct interface *iface)
}
break;
case IFS_DOWN:
}
break;
case IFS_DOWN:
- if (iface->enabled && iface->link_state && !config_init)
+ if (iface->
autostart && iface->
enabled && iface->link_state && !config_init)
__interface_set_up(iface);
break;
default:
__interface_set_up(iface);
break;
default: