{
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct switch_val *val = arg;
- struct switch_attr *attr = val->attr;
if (!val)
goto error;
val.value.i = atoi(str);
break;
case SWITCH_TYPE_STRING:
- val.value.s = str;
+ val.value.s = (char *)str;
break;
case SWITCH_TYPE_PORTS:
ports = alloca(sizeof(struct switch_port) * dev->ports);
static int
list_switch(struct nl_msg *msg, void *arg)
{
- struct swlib_scan_arg *sa = arg;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
- struct switch_dev *dev;
- const char *name;
- const char *alias;
if (nla_parse(tb, SWITCH_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL) < 0)
goto done;
swlib_connect(const char *name)
{
struct swlib_scan_arg arg;
- int err;
if (!refcount) {
if (swlib_priv_init() < 0)
swlib_free_attributes(&dev->ops);
swlib_free_attributes(&dev->port_ops);
swlib_free_attributes(&dev->vlan_ops);
+ free(dev->name);
+ free(dev->alias);
free(dev);
if (--refcount == 0)