if (iface->state == IFS_UP)
interface_event(iface, IFEV_DOWN);
iface->state = IFS_TEARDOWN;
+ interface_ip_flush(&iface->config_ip);
+ interface_ip_flush(&iface->proto_ip);
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
if (force)
interface_flush_state(iface);
if (state->sm == S_TEARDOWN)
return 0;
+ if (state->l3_dev.dev)
+ device_remove_user(&state->l3_dev);
+
if (state->script_task.uloop.pending) {
if (state->sm != S_SETUP_ABORT) {
uloop_timeout_set(&state->teardown_timeout, 1000);
struct proto_shell_state *state;
state = container_of(proto, struct proto_shell_state, proto);
+ if (state->l3_dev.dev)
+ device_remove_user(&state->l3_dev);
netifd_kill_process(&state->script_task);
netifd_kill_process(&state->proto_task);
free(state->config);