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

Hans Dedecker dedeckeh at gmail.com
Thu Jul 14 04:14:14 EDT 2016

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
Therefore restrict the teardown action for shell protocols having no proto task.

Signed-off-by: Hans Dedecker <dedeckeh at 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) {
-		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);
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list