diff options
author | Matt Dunwoodie <ncon@noconroy.net> | 2021-04-21 01:02:20 +1000 |
---|---|---|
committer | Matt Dunwoodie <ncon@noconroy.net> | 2021-04-21 01:02:55 +1000 |
commit | c493910bda9547436080993fb559b81c29242b99 (patch) | |
tree | 9371765b7807bc2d0bdf2dfb35223275422609a3 /src/if_wg.c | |
parent | wg_noise: avoid handshake/keypair type confusion (diff) | |
download | wireguard-freebsd-c493910bda9547436080993fb559b81c29242b99.tar.xz wireguard-freebsd-c493910bda9547436080993fb559b81c29242b99.zip |
wg_noise: ensure we check peer count on hashtable insert
Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
Diffstat (limited to 'src/if_wg.c')
-rw-r--r-- | src/if_wg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/if_wg.c b/src/if_wg.c index f41878a..5b5e200 100644 --- a/src/if_wg.c +++ b/src/if_wg.c @@ -2152,7 +2152,8 @@ wg_peer_add(struct wg_softc *sc, const nvlist_t *nvl) } } if (need_insert) { - noise_remote_enable(peer->p_remote); + if ((err = noise_remote_enable(peer->p_remote)) != 0) + goto out; TAILQ_INSERT_TAIL(&sc->sc_peers, peer, p_entry); sc->sc_peers_num++; if (sc->sc_ifp->if_link_state == LINK_STATE_UP) |