send FastDatapathCryptoInitSARemote control message only if encryption is enabled

Fixes #3781
This commit is contained in:
Murali Reddy committed 2020-03-11 21:26:09 +05:30
1 parent 57bca8e955
commit 6bc0e5e71c
1 file changed
+6 -4
+6 -4
View File
@@ -694,10 +694,12 @@ func (fwd *fastDatapathForwarder) Confirm() {
fwd.lock.Unlock() // unlock before calling send() which may block
if err := fwd.sendControlMsg(FastDatapathCryptoInitSARemote, controlMsg); err != nil {
log.Error(fwd.logPrefix(), "ipsec send InitSARemote failed: ", err)
fwd.handleError(err)
return
if len(controlMsg) > 0 {
if err := fwd.sendControlMsg(FastDatapathCryptoInitSARemote, controlMsg); err != nil {
log.Error(fwd.logPrefix(), "ipsec send InitSARemote failed: ", err)
fwd.handleError(err)
return
}
}
go fwd.doHeartbeats()