if (dev)
device_add_user(&iface->main_dev, dev);
}
+ if (iface->proto_handler->flags & PROTO_FLAG_INIT_AVAILABLE)
+ interface_set_available(iface, true);
}
set_config_state(if_old, IFC_REMOVE);
} else if (node_new) {
D(INTERFACE, "Create interface '%s'\n", if_new->name);
- interface_claim_device(if_new);
proto_init_interface(if_new, if_new->config);
+ interface_claim_device(if_new);
netifd_ubus_add_interface(if_new);
}
}
struct proto_handler proto;
struct config_param_list config;
char *config_buf;
+ bool init_available;
char script_name[];
};
if (tmp && json_object_get_boolean(tmp))
handler->proto.flags |= PROTO_FLAG_NODEV;
+ tmp = get_field(obj, "available", json_type_boolean);
+ if (tmp && json_object_get_boolean(tmp))
+ handler->proto.flags |= PROTO_FLAG_INIT_AVAILABLE;
+
config = get_field(obj, "config", json_type_array);
if (config)
handler->config_buf = proto_shell_parse_config(&handler->config, config);
enum {
PROTO_FLAG_IMMEDIATE = (1 << 0),
PROTO_FLAG_NODEV = (1 << 1),
+ PROTO_FLAG_INIT_AVAILABLE = (1 << 2),
};
struct interface_proto_state {