[IFACE_ATTR_FORCE_LINK] = { .name = "force_link", .type = BLOBMSG_TYPE_BOOL },
};
-static const struct uci_blob_param_info iface_attr_info[IFACE_ATTR_MAX] = {
- [IFACE_ATTR_DNS] = { .type = BLOBMSG_TYPE_STRING },
- [IFACE_ATTR_IP6CLASS] = { .type = BLOBMSG_TYPE_STRING },
-};
-
const struct uci_blob_param_list interface_attr_list = {
.n_params = IFACE_ATTR_MAX,
.params = iface_attrs,
- .info = iface_attr_info,
};
static void
memcpy(dest, data[i], datalen[i]);
dest += datalen[i];
}
- error->data[n_data++] = NULL;
+ error->data[n_data] = NULL;
if (subsystem)
error->subsystem = strcpy(d_subsys, subsystem);
}
static void
+interface_set_device_config(struct interface *iface, struct device *dev)
+{
+ if (!dev || !dev->default_config)
+ return;
+
+ if (!iface->device_config &&
+ (!dev->iface_config || dev->config_iface != iface))
+ return;
+
+ dev->config_iface = iface;
+ dev->iface_config = iface->device_config;
+ device_apply_config(dev, dev->type, iface->config);
+}
+
+static void
interface_claim_device(struct interface *iface)
{
struct interface *parent;
} else if (iface->ifname &&
!(iface->proto_handler->flags & PROTO_FLAG_NODEV)) {
dev = device_get(iface->ifname, true);
- if (dev && dev->default_config && iface->device_config)
- device_apply_config(dev, dev->type, iface->config);
+ interface_set_device_config(iface, dev);
} else {
dev = iface->ext_dev.dev;
}
}
if (add) {
- if (iface->device_config && dev->default_config)
- device_apply_config(dev, dev->type, iface->config);
-
+ interface_set_device_config(iface, dev);
device_set_present(dev, true);
ret = interface_add_link(iface, dev, link_ext);
struct blob_attr *ntb[__DEV_ATTR_MAX];
struct blob_attr *otb[__DEV_ATTR_MAX];
struct device *dev = if_old->main_dev.dev;
- unsigned long diff;
+ unsigned long diff = 0;
BUILD_BUG_ON(sizeof(diff) < __DEV_ATTR_MAX / 8);