mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-22 00:11:29 +02:00
[client] Add comment explaining kernel-only RemovePeer guard
This commit is contained in:
@@ -67,6 +67,9 @@ func (d *UDPListener) ReadPackets() {
|
||||
}
|
||||
|
||||
d.peerCfg.Log.Debugf("removing lazy endpoint: %s", d.endpoint.String())
|
||||
// In kernel mode, RemovePeer is required to force a new handshake initiation on the real endpoint.
|
||||
// In userspace mode, the WireGuard-go patch triggers SendStagedPackets via IpcSet/handlePostConfig
|
||||
// when UpdatePeer is called after ICE/relay negotiation, so the removal is not needed.
|
||||
if !d.wgIface.IsUserspaceBind() {
|
||||
if err := d.wgIface.RemovePeer(d.peerCfg.PublicKey); err != nil {
|
||||
d.peerCfg.Log.Errorf("failed to remove endpoint: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user