static void
put_container(struct blob_buf *buf, struct blob_attr *attr, const char *name)
{
- void *c = blobmsg_open_table(&b, name);
- blob_put_raw(&b, blob_data(attr), blob_len(attr));
- blobmsg_close_table(&b, c);
+ void *c = blobmsg_open_table(buf, name);
+ blob_put_raw(buf, blob_data(attr), blob_len(attr));
+ blobmsg_close_table(buf, c);
}
static void
if (!vif->network || !vif->ifname)
return;
+ if (up) {
+ struct device *dev = device_get(vif->ifname, 2);
+ if (dev)
+ dev->wireless = true;
+ }
+
blobmsg_for_each_attr(cur, vif->network, rem) {
network = blobmsg_data(cur);
if (!iface)
continue;
- interface_handle_link(iface, vif->ifname, up);
+ interface_handle_link(iface, vif->ifname, up, true);
}
}
struct wireless_interface *vif;
struct blob_attr *tb[__VIF_ATTR_MAX];
struct blob_attr *cur;
- char *name_buf;
+ char *name_buf, *section_buf;
char name[8];
blobmsg_parse(vif_policy, __VIF_ATTR_MAX, tb, blob_data(data), blob_len(data));
sprintf(name, "%d", wdev->vif_idx++);
- vif = calloc_a(sizeof(*vif), &name_buf, strlen(name) + 1);
+ vif = calloc_a(sizeof(*vif),
+ &name_buf, strlen(name) + 1,
+ §ion_buf, strlen(section) + 1);
vif->name = strcpy(name_buf, name);
vif->wdev = wdev;
vif->config = data;
- vif->section = section;
+ vif->section = strcpy(section_buf, section);
vlist_add(&wdev->interfaces, &vif->node, vif->name);
}