diff options
Diffstat (limited to 'src/plugins/wireguard/wireguard_api.c')
-rwxr-xr-x | src/plugins/wireguard/wireguard_api.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/wireguard/wireguard_api.c b/src/plugins/wireguard/wireguard_api.c index 283c09915fe..c9fe1e1a2d2 100755 --- a/src/plugins/wireguard/wireguard_api.c +++ b/src/plugins/wireguard/wireguard_api.c @@ -43,6 +43,8 @@ static void u32 sw_if_index = ~0; int rv = 0; + wg_feature_init (wmp); + ip_address_decode2 (&mp->interface.src_ip, &src); if (AF_IP6 == ip_addr_version (&src)) @@ -75,6 +77,8 @@ static void wg_main_t *wmp = &wg_main; int rv = 0; + wg_feature_init (wmp); + VALIDATE_SW_IF_INDEX (mp); rv = wg_if_delete (ntohl (mp->sw_if_index)); @@ -125,6 +129,9 @@ vl_api_wireguard_interface_dump_t_handler (vl_api_wireguard_interface_dump_t * mp) { vl_api_registration_t *reg; + wg_main_t *wmp = &wg_main; + + wg_feature_init (wmp); reg = vl_api_client_index_to_registration (mp->client_index); if (reg == 0) @@ -157,6 +164,8 @@ vl_api_wireguard_peer_add_t_handler (vl_api_wireguard_peer_add_t * mp) goto done; } + wg_feature_init (wmp); + vec_validate (allowed_ips, mp->peer.n_allowed_ips - 1); ip_address_decode2 (&mp->peer.endpoint, &endpoint); @@ -195,6 +204,8 @@ vl_api_wireguard_peer_remove_t_handler (vl_api_wireguard_peer_remove_t * mp) wg_main_t *wmp = &wg_main; int rv = 0; + wg_feature_init (wmp); + rv = wg_peer_remove (ntohl (mp->peer_index)); /* *INDENT-OFF* */ @@ -247,6 +258,9 @@ static void vl_api_wireguard_peers_dump_t_handler (vl_api_wireguard_peers_dump_t * mp) { vl_api_registration_t *reg; + wg_main_t *wmp = &wg_main; + + wg_feature_init (wmp); reg = vl_api_client_index_to_registration (mp->client_index); if (reg == NULL) |