diff mbox

[OpenWrt-Devel,netifd,2/3] interface: Only teardown interfaces having no proto task when l3_dev link lost

Message ID 1468484055-27341-2-git-send-email-dedeckeh@gmail.com
State Changes Requested
Delegated to: John Crispin
Headers show

Commit Message

Hans Dedecker July 14, 2016, 8:14 a.m. UTC
Commit c6858766 adds teardown support when l3_dev link is lost especially for shell protocols
that have no proto task. However shell protocols which have a proto task running like ppp will
also be teared down which is not always the expected action.
As an example the PPP daemon can be put into persist state trying to re-establish the link via
a hold off mechanism which is not possible when the daemon is terminated by the proto shell
teardown.
Therefore restrict the teardown action for shell protocols having no proto task.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
---
 interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/interface.c b/interface.c
index 7b18cef..8d9dc9c 100644
--- a/interface.c
+++ b/interface.c
@@ -408,7 +408,8 @@  interface_l3_dev_cb(struct device_user *dep, enum device_event ev)
 
 	switch (ev) {
 	case DEV_EVENT_LINK_DOWN:
-		interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
+		if (iface->proto->handler->flags & PROTO_FLAG_NO_TASK)
+			interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
 		break;
 	default:
 		break;