On UAPI, just pass along the -. On other platforms, return an error and
add a TODO comment.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
nvl_aips[j] = nvlist_create(0);
if (!nvl_aips[j])
goto err_peer;
+ if (aip->flags) {
+ //TODO: implement me
+ ret = -EOPNOTSUPP;
+ goto err_peer;
+ }
nvlist_add_number(nvl_aips[j], "cidr", aip->cidr);
if (aip->family == AF_INET)
nvlist_add_binary(nvl_aips[j], "ipv4", &aip->ip4, sizeof(aip->ip4));
aip_count = 0;
wg_aip = &wg_peer->p_aips[0];
for_each_wgallowedip(peer, aip) {
+ if (aip->flags) {
+ //TODO: implement me
+ errno = EOPNOTSUPP;
+ goto out;
+ }
wg_aip->a_af = aip->family;
wg_aip->a_cidr = aip->cidr;
continue;
} else
continue;
- fprintf(f, "allowed_ip=%s/%d\n", ip, allowedip->cidr);
+ fprintf(f, "allowed_ip=%s%s/%d\n", (allowedip->flags & WGALLOWEDIP_REMOVE_ME) ? "-" : "", ip, allowedip->cidr);
}
}
fprintf(f, "\n");
aip_count = 0;
wg_aip = (void *)wg_peer + sizeof(WG_IOCTL_PEER);
for_each_wgallowedip(peer, aip) {
+ if (aip->flags) {
+ //TODO: implement me
+ errno = EOPNOTSUPP;
+ goto out;
+ }
+
wg_aip->AddressFamily = aip->family;
wg_aip->Cidr = aip->cidr;