Clear cryptographic state when interface down

Attempts to clear the cryptographic state for every
peer when the device goes down.
This commit is contained in:
Mathias Hall-Andersen 2018-02-02 17:24:29 +01:00
parent 029410b118
commit 4f97b52ea6
5 changed files with 58 additions and 41 deletions

View file

@ -38,5 +38,7 @@ func (kp *KeyPairs) Current() *KeyPair {
}
func (device *Device) DeleteKeyPair(key *KeyPair) {
device.indices.Delete(key.localIndex)
if key != nil {
device.indices.Delete(key.localIndex)
}
}