struct blob_attr *cur;
const char *proto_name = NULL;
char *iface_name;
+ bool force_link = false;
iface = calloc_a(sizeof(*iface), &iface_name, strlen(name) + 1);
iface->name = strcpy(iface_name, name);
proto_name = blobmsg_data(cur);
proto_attach_interface(iface, proto_name);
+ if (iface->proto_handler->flags & PROTO_FLAG_FORCE_LINK_DEFAULT)
+ force_link = true;
iface->autostart = blobmsg_get_bool_default(tb[IFACE_ATTR_AUTO], true);
- iface->force_link = blobmsg_get_bool_default(tb[IFACE_ATTR_FORCE_LINK], false);
+ iface->force_link = blobmsg_get_bool_default(tb[IFACE_ATTR_FORCE_LINK], force_link);
iface->proto_ip.no_defaultroute =
!blobmsg_get_bool_default(tb[IFACE_ATTR_DEFAULTROUTE], true);
iface->proto_ip.no_dns =
static struct proto_handler static_proto = {
.name = "static",
- .flags = PROTO_FLAG_IMMEDIATE,
+ .flags = PROTO_FLAG_IMMEDIATE |
+ PROTO_FLAG_FORCE_LINK_DEFAULT,
.config_params = &proto_ip_attr,
.attach = static_attach,
};
PROTO_FLAG_NODEV = (1 << 1),
PROTO_FLAG_INIT_AVAILABLE = (1 << 2),
PROTO_FLAG_RENEW_AVAILABLE = (1 << 3),
+ PROTO_FLAG_FORCE_LINK_DEFAULT = (1 << 4),
};
struct interface_proto_state {