properly handle closetunnel packets (#1638)

This commit is contained in:
Jack Doan
2026-03-25 11:59:37 -05:00
committed by GitHub
parent 9f1aef53fa
commit 91d1f4675a
2 changed files with 112 additions and 0 deletions

View File

@@ -190,6 +190,13 @@ func (f *Interface) readOutsidePackets(via ViaSender, out []byte, packet []byte,
if !f.handleEncrypted(ci, via, h) {
return
}
_, err = f.decrypt(hostinfo, h.MessageCounter, out, packet, h, nb)
if err != nil {
hostinfo.logger(f.l).WithError(err).WithField("from", via).
WithField("packet", packet).
Error("Failed to decrypt CloseTunnel packet")
return
}
hostinfo.logger(f.l).WithField("from", via).
Info("Close tunnel received, tearing down.")