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/keypair.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/keypair.go')
-rw-r--r-- | src/keypair.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keypair.go b/src/keypair.go index 7e5297b..283cb92 100644 --- a/src/keypair.go +++ b/src/keypair.go @@ -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) + } } |