mark_interface_down(iface);
break;
+ case IFPEV_LINK_LOST:
+ if (iface->state != IFS_UP)
+ return;
+
+ iface->state = IFS_SETUP;
+ interface_event(iface, IFEV_DOWN);
+ break;
}
}
return 0;
}
-static void
-proto_shell_set_down(struct proto_shell_state *state)
-{
- if (!state->l3_dev.dev)
- return;
-
- device_remove_user(&state->l3_dev);
-}
-
static int
proto_shell_handler(struct interface_proto_state *proto,
enum interface_proto_cmd cmd, bool force)
struct proto_shell_state *state;
state = container_of(p, struct proto_shell_state, teardown_task);
- proto_shell_set_down(state);
state->proto.proto_event(&state->proto, IFPEV_DOWN);
+ device_remove_user(&state->l3_dev);
}
static void
state->proto.iface->l3_dev = &state->l3_dev;
state->proto.proto_event(&state->proto, IFPEV_UP);
} else {
- proto_shell_set_down(state);
+ state->proto.proto_event(&state->proto, IFPEV_LINK_LOST);
}
return 0;