proto-shell: Support teardown on layer 3 link loss
[project/netifd.git] / interface.c
index b9833d3..0b9893c 100644 (file)
@@ -414,7 +414,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_TEARDOWN_ON_L3_LINK_DOWN)
+                       interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
                break;
        default:
                break;