mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
wg: ipc: add allowed-ip flags support for FreeBSD
For $reasons, we can't rely on flags in wireguard-tools for the kernel side of WireGuard. Provide a mapping function that uses flags from the kernel that we're building against and fail the operation if we made it to the end without turning some wg(8) flag off. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Reviewed by: ivy (previous version), Jason A. Donenfeld, jhb Differential Revision: https://reviews.freebsd.org/D50450
This commit is contained in:
parent
d15d610fac
commit
f6d9e22982
1 changed files with 2 additions and 5 deletions
|
|
@ -307,11 +307,8 @@ static int kernel_set_device(struct wgdevice *dev)
|
|||
nvl_aips[j] = nvlist_create(0);
|
||||
if (!nvl_aips[j])
|
||||
goto err_peer;
|
||||
if (aip->flags) {
|
||||
//TODO: implement me
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_peer;
|
||||
}
|
||||
if (aip->flags)
|
||||
nvlist_add_number(nvl_aips[j], "flags", aip->flags);
|
||||
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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue