mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-14 22:34:18 +03:00
conn: make binds replacable
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
1 parent
c69481f1b3
commit
a4f8e83d5d
16 files changed
+160
-149
No files matched your search
+2
-7
@@ -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