wireguard: add atomic mutex 61/37361/5
authorGabriel Oginski <gabrielx.oginski@intel.com>
Thu, 6 Oct 2022 06:58:45 +0000 (06:58 +0000)
committerGabriel Oginski <gabrielx.oginski@intel.com>
Thu, 1 Dec 2022 06:47:07 +0000 (06:47 +0000)
commit583d4c94dc69f624a44a8dfa5c82165f3ca27271
tree47ec5fefeabff30ee53dae04d131a227c7dd7687
parent4afdfb4a069558a65269f26061c02a5d24632f6a
wireguard: add atomic mutex

The initiate handshake process can be called a numbers times for each
peers, then the main VPP thread called by Wireguard starting to
allocate memory. This behaviour can lead to out of memory when VPP has
a lot of Wireguard tunnels concurrently.

This fix add mutex to send only once handshake initiate at time for
each peers.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I13b4b2d47021753926d42a38ccadb36a411c5b79
src/plugins/wireguard/wireguard_peer.c
src/plugins/wireguard/wireguard_peer.h
src/plugins/wireguard/wireguard_send.c