diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-02 17:24:29 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-02 17:24:29 +0100 |
commit | 4f97b52ea60ce4f2448d8617853aa44759727197 (patch) | |
tree | b130341a75677a627c9649bfe4532e19c946b755 /src/device.go | |
parent | 029410b118f079d77fa448cf56a97b949faee126 (diff) |
Clear cryptographic state when interface down
Attempts to clear the cryptographic state for every
peer when the device goes down.
Diffstat (limited to 'src/device.go')
-rw-r--r-- | src/device.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/device.go b/src/device.go index 0317b60..c041987 100644 --- a/src/device.go +++ b/src/device.go @@ -88,28 +88,6 @@ func unsafeRemovePeer(device *Device, peer *Peer, key NoisePublicKey) { device.routing.table.RemovePeer(peer) peer.Stop() - // clean index table - - kp := &peer.keyPairs - kp.mutex.Lock() - - if kp.previous != nil { - device.indices.Delete(kp.previous.localIndex) - } - - if kp.current != nil { - device.indices.Delete(kp.current.localIndex) - } - - if kp.next != nil { - device.indices.Delete(kp.next.localIndex) - } - - kp.previous = nil - kp.current = nil - kp.next = nil - kp.mutex.Unlock() - // remove from peer map delete(device.peers.keyMap, key) |