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 <dedec...@gmail.com>
---
 interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
-- 
1.9.1


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to