summaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard/wireguard_if.h
diff options
context:
space:
mode:
authorArtem Glazychev <artem.glazychev@xored.com>2021-05-25 12:06:42 +0700
committerEd Warnicke <hagbard@gmail.com>2021-10-04 16:21:34 +0000
commit9e24f7eb911fc5ab7558109286fe8e1d2774ea93 (patch)
treef7aa375e88ee3d2325fb430bc4012b1ff012d734 /src/plugins/wireguard/wireguard_if.h
parent039f289e516b073f6db67f7b35aa3aa64fdc9c82 (diff)
wireguard: use the same udp-port for multi-tunnel
now we can reuse udp-port for many wireguard interfaces Type: improvement Change-Id: I14b5a9dbe917d83300ccb4d6907743d88355e5c5 Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Diffstat (limited to 'src/plugins/wireguard/wireguard_if.h')
-rw-r--r--src/plugins/wireguard/wireguard_if.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/wireguard/wireguard_if.h b/src/plugins/wireguard/wireguard_if.h
index e43557b56fe..3153a380066 100644
--- a/src/plugins/wireguard/wireguard_if.h
+++ b/src/plugins/wireguard/wireguard_if.h
@@ -71,16 +71,16 @@ wg_if_get (index_t wgii)
return (pool_elt_at_index (wg_if_pool, wgii));
}
-extern index_t *wg_if_index_by_port;
+extern index_t **wg_if_indexes_by_port;
-static_always_inline wg_if_t *
-wg_if_get_by_port (u16 port)
+static_always_inline index_t *
+wg_if_indexes_get_by_port (u16 port)
{
- if (vec_len (wg_if_index_by_port) < port)
+ if (vec_len (wg_if_indexes_by_port) == 0)
return (NULL);
- if (INDEX_INVALID == wg_if_index_by_port[port])
+ if (vec_len (wg_if_indexes_by_port[port]) == 0)
return (NULL);
- return (wg_if_get (wg_if_index_by_port[port]));
+ return (wg_if_indexes_by_port[port]);
}