mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-05 08:36:57 +08:00
conn: make binds replacable
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -126,13 +126,8 @@ func (peer *Peer) SendBuffer(buffer []byte) error {
|
||||
peer.device.net.RLock()
|
||||
defer peer.device.net.RUnlock()
|
||||
|
||||
if peer.device.net.bind == nil {
|
||||
// Packets can leak through to SendBuffer while the device is closing.
|
||||
// When that happens, drop them silently to avoid spurious errors.
|
||||
if peer.device.isClosed() {
|
||||
return nil
|
||||
}
|
||||
return errors.New("no bind")
|
||||
if peer.device.isClosed() {
|
||||
return nil
|
||||
}
|
||||
|
||||
peer.RLock()
|
||||
|
Reference in New Issue
Block a user