aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard/wireguard_input.c
diff options
context:
space:
mode:
authorArtem Glazychev <artem.glazychev@xored.com>2021-05-20 12:33:52 +0700
committerEd Warnicke <hagbard@gmail.com>2021-09-30 14:15:58 +0000
commitde3caf37c64431c199fe649256b268010ce6a4f3 (patch)
tree915f8d41835c3709f34f14cc56d4ee9eb45044eb /src/plugins/wireguard/wireguard_input.c
parentda33105973e5f98d9c0daf8e107299d6a278d146 (diff)
wireguard: move adjacency processing from wireguard_peer to wireguard_interface
now we should add routes manually Type: improvement Change-Id: I877511a18854efdfad02939267d38a216b2ccec3 Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Diffstat (limited to 'src/plugins/wireguard/wireguard_input.c')
-rw-r--r--src/plugins/wireguard/wireguard_input.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/plugins/wireguard/wireguard_input.c b/src/plugins/wireguard/wireguard_input.c
index 5db814292f8..8dfba7615ef 100644
--- a/src/plugins/wireguard/wireguard_input.c
+++ b/src/plugins/wireguard/wireguard_input.c
@@ -254,24 +254,6 @@ wg_handshake_process (vlib_main_t * vm, wg_main_t * wmp, vlib_buffer_t * b)
return WG_INPUT_ERROR_NONE;
}
-static_always_inline bool
-fib_prefix_is_cover_addr_4 (const fib_prefix_t * p1,
- const ip4_address_t * ip4)
-{
- switch (p1->fp_proto)
- {
- case FIB_PROTOCOL_IP4:
- return (ip4_destination_matches_route (&ip4_main,
- &p1->fp_addr.ip4,
- ip4, p1->fp_len) != 0);
- case FIB_PROTOCOL_IP6:
- return (false);
- case FIB_PROTOCOL_MPLS:
- break;
- }
- return (false);
-}
-
VLIB_NODE_FN (wg_input_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame)
@@ -386,7 +368,7 @@ VLIB_NODE_FN (wg_input_node) (vlib_main_t * vm,
ip4_header_t *iph = vlib_buffer_get_current (b[0]);
- const wg_peer_allowed_ip_t *allowed_ip;
+ const fib_prefix_t *allowed_ip;
bool allowed = false;
/*
@@ -396,8 +378,7 @@ VLIB_NODE_FN (wg_input_node) (vlib_main_t * vm,
*/
vec_foreach (allowed_ip, peer->allowed_ips)
{
- if (fib_prefix_is_cover_addr_4 (&allowed_ip->prefix,
- &iph->src_address))
+ if (fib_prefix_is_cover_addr_4 (allowed_ip, &iph->src_address))
{
allowed = true;
break;