Do not do ipsec.InitSARemote on a stopped fastDatapathForwarder.

Fixes 3675

It is possible for ipsec.InitSARemote to be called after ipsec.Destroy.
If an xfrm policy for that source/destination pair exists it will be
updated to the SPI from the Destroyed connection causing IPSEC to stop
working.
This commit is contained in:
Hendrik van Wyk committed 2019-07-31 11:17:37 +02:00
1 parent b05c5f63c8
commit 96291d1de4
1 file changed
+5
+5
View File
@@ -881,6 +881,11 @@ func (fwd *fastDatapathForwarder) handleHeartbeatAck() {
}
func (fwd *fastDatapathForwarder) handleCryptoInitSARemote(msg []byte) {
if fwd.stopped {
log.Info(fwd.logPrefix(), "IPSec init SA remote failed: forwarder has already been stopped")
return
}
log.Info(fwd.logPrefix(), "IPSec init SA remote")
err := fwd.fastdp.ipsec.InitSARemote(
msg,