projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b48b50
)
fix interface event handling, suppress redundant down events
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 3 Nov 2011 19:57:06 +0000
(20:57 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 3 Nov 2011 19:57:06 +0000
(20:57 +0100)
interface.c
patch
|
blob
|
history
diff --git
a/interface.c
b/interface.c
index
787d7d9
..
257eaca
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-100,6
+100,8
@@
interface_flush_state(struct interface *iface)
static void
mark_interface_down(struct interface *iface)
{
static void
mark_interface_down(struct interface *iface)
{
+ if (iface->state == IFS_UP)
+ interface_event(iface, IFEV_DOWN);
interface_flush_state(iface);
iface->state = IFS_DOWN;
}
interface_flush_state(iface);
iface->state = IFS_DOWN;
}
@@
-113,8
+115,9
@@
__interface_set_down(struct interface *iface, bool force)
iface->state == IFS_TEARDOWN)
return;
iface->state == IFS_TEARDOWN)
return;
+ if (iface->state == IFS_UP)
+ interface_event(iface, IFEV_DOWN);
iface->state = IFS_TEARDOWN;
iface->state = IFS_TEARDOWN;
- 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);
@@
-274,8
+277,9
@@
interface_proto_cb(struct interface_proto_state *state, enum interface_proto_eve
return;
netifd_log_message(L_NOTICE, "Interface '%s' has lost the connection\n", iface->name);
return;
netifd_log_message(L_NOTICE, "Interface '%s' has lost the connection\n", iface->name);
+ if (iface->state == IFS_UP)
+ interface_event(iface, IFEV_DOWN);
iface->state = IFS_SETUP;
iface->state = IFS_SETUP;
- interface_event(iface, IFEV_DOWN);
break;
}
}
break;
}
}