iface->main_dev.cb = interface_cb;
iface->l3_iface = &iface->main_dev;
strncpy(iface->name, name, sizeof(iface->name) - 1);
iface->main_dev.cb = interface_cb;
iface->l3_iface = &iface->main_dev;
strncpy(iface->name, name, sizeof(iface->name) - 1);
INIT_LIST_HEAD(&iface->errors);
INIT_LIST_HEAD(&iface->address);
INIT_LIST_HEAD(&iface->routes);
INIT_LIST_HEAD(&iface->errors);
INIT_LIST_HEAD(&iface->address);
INIT_LIST_HEAD(&iface->routes);
blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb,
blob_data(attr), blob_len(attr));
blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb,
blob_data(attr), blob_len(attr));
- if ((cur = tb[IFACE_ATTR_TYPE])) {
- if (!strcmp(blobmsg_data(cur), "bridge"))
- interface_attach_bridge(iface, s);
- }
+ if ((cur = tb[IFACE_ATTR_PROTO]))
+ proto_name = blobmsg_data(cur);
+
+ proto_attach_interface(iface, proto_name);
if ((cur = tb[IFACE_ATTR_IFNAME])) {
dev = device_get(blobmsg_data(cur), true);
if ((cur = tb[IFACE_ATTR_IFNAME])) {
dev = device_get(blobmsg_data(cur), true);
{
struct interface *iface;
list_for_each_entry(iface, &interfaces, list) {
if (iface->active && iface->autostart)
{
struct interface *iface;
list_for_each_entry(iface, &interfaces, list) {
if (iface->active && iface->autostart)