if (!iface)
return;
- interface_init(iface, s->e.name, b.head, false);
+ interface_init(iface, s->e.name, b.head);
if (iface->proto_handler && iface->proto_handler->config_params)
uci_to_blob(&b, s, iface->proto_handler->config_params);
void
interface_init(struct interface *iface, const char *name,
- struct blob_attr *config, bool dynamic)
+ struct blob_attr *config)
{
struct blob_attr *tb[IFACE_ATTR_MAX];
struct blob_attr *cur;
iface->proto_ip.no_delegation = !blobmsg_get_bool_default(tb[IFACE_ATTR_DELEGATE], true);
iface->config_autostart = iface->autostart;
- iface->dynamic = dynamic;
+}
- if (iface->dynamic)
- iface->node.version = -1; // Don't delete on reload
+void interface_set_dynamic(struct interface *iface)
+{
+ iface->dynamic = true;
+ iface->node.version = -1; // Don't delete on reload
}
static bool __interface_add(struct interface *iface, struct blob_attr *config, bool alias)
extern const struct uci_blob_param_list interface_attr_list;
void interface_init(struct interface *iface, const char *name,
- struct blob_attr *config, bool dynamic);
+ struct blob_attr *config);
+
+void interface_set_dynamic(struct interface *iface);
void interface_add(struct interface *iface, struct blob_attr *config);
bool interface_add_alias(struct interface *iface, struct blob_attr *config);
if (!iface)
return UBUS_STATUS_UNKNOWN_ERROR;
- interface_init(iface, name, msg, true);
+ interface_init(iface, name, msg);
+ interface_set_dynamic(iface);
iface->device_config = true;
config = blob_memdup(msg);