return clr_config_net_l2proxy(key, lxc_conf, data);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
ret = lxc_safe_uint(value, &val);
if (ret < 0)
- return minus_one_set_errno(-ret);
+ return ret_set_errno(-1, -ret);
switch (val) {
case 0:
return 0;
}
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
}
static int set_config_net_name(const char *key, const char *value,
return clr_config_net_ipvlan_mode(key, lxc_conf, data);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN) {
SYSERROR("Invalid ipvlan mode \"%s\", can only be used with ipvlan network", value);
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
}
return lxc_ipvlan_mode_to_flag(&netdev->priv.ipvlan_attr.mode, value);
return clr_config_net_ipvlan_isolation(key, lxc_conf, data);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN) {
SYSERROR("Invalid ipvlan isolation \"%s\", can only be used with ipvlan network", value);
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
}
return lxc_ipvlan_isolation_to_flag(&netdev->priv.ipvlan_attr.isolation, value);
return clr_config_net_veth_ipv4_route(key, lxc_conf, data);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH) {
SYSERROR("Invalid ipv4 route \"%s\", can only be used with veth network", value);
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
}
inetdev = malloc(sizeof(*inetdev));
slash = strchr(valdup, '/');
if (!slash)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
*slash = '\0';
slash++;
if (*slash == '\0')
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
netmask = slash;
ret = lxc_safe_uint(netmask, &inetdev->prefix);
if (ret < 0 || inetdev->prefix > 32)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
ret = inet_pton(AF_INET, valdup, &inetdev->addr);
if (!ret || ret < 0)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
lxc_list_add_tail(&netdev->priv.veth_attr.ipv4_routes, list);
move_ptr(inetdev);
return clr_config_net_veth_ipv6_route(key, lxc_conf, data);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH) {
SYSERROR("Invalid ipv6 route \"%s\", can only be used with veth network", value);
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
}
inet6dev = malloc(sizeof(*inet6dev));
slash = strchr(valdup, '/');
if (!slash)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
*slash = '\0';
slash++;
if (*slash == '\0')
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
netmask = slash;
ret = lxc_safe_uint(netmask, &inet6dev->prefix);
if (ret < 0 || inet6dev->prefix > 128)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
ret = inet_pton(AF_INET6, valdup, &inet6dev->addr);
if (!ret || ret < 0)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
lxc_list_add_tail(&netdev->priv.veth_attr.ipv6_routes, list);
move_ptr(inet6dev);
return -1;
if (lxc_conf->seccomp.allow_nesting > 1)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
return 0;
#else
#ifdef HAVE_SECCOMP_NOTIFY
return set_config_string_item(&lxc_conf->seccomp.notifier.cookie, value);
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
return clr_config_seccomp_notify_proxy(key, lxc_conf, NULL);
if (strncmp(value, "unix:", 5) != 0)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
offset = value + 5;
if (lxc_unix_sockaddr(&lxc_conf->seccomp.notifier.proxy_addr, offset) < 0)
return 0;
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
#ifdef HAVE_SECCOMP_NOTIFY
return lxc_get_conf_str(retv, inlen, c->seccomp.notifier.cookie);
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
? &c->seccomp.notifier.proxy_addr.sun_path[0]
: &c->seccomp.notifier.proxy_addr.sun_path[1]);
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
c->seccomp.notifier.cookie = NULL;
return 0;
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
sizeof(c->seccomp.notifier.proxy_addr));
return 0;
#else
- return minus_one_set_errno(ENOSYS);
+ return ret_set_errno(-1, ENOSYS);
#endif
}
struct lxc_netdev *netdev = data;
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
netdev->l2proxy = false;
struct lxc_netdev *netdev = data;
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN)
return 0;
struct lxc_netdev *netdev = data;
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN)
return 0;
struct lxc_netdev *netdev = data;
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH)
return 0;
memset(retv, 0, inlen);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN)
return 0;
memset(retv, 0, inlen);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_IPVLAN)
return 0;
memset(retv, 0, inlen);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH)
return 0;
memset(retv, 0, inlen);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH)
return 0;
memset(retv, 0, inlen);
if (!netdev)
- return minus_one_set_errno(EINVAL);
+ return ret_set_errno(-1, EINVAL);
if (netdev->type != LXC_NET_VETH)
return 0;