fix: disable the whole underload if DisableCookies is on

Thanks to @darkk for spotting and suggesting the fix
This commit is contained in:
Yaroslav Gurov authored and Yaroslav Gurov committed 2026-08-28 17:48:27 +02:00
1 parent da11c9fadc
commit b5928efb6c
2 files changed
+2 -6

No files matched your search

+2 -1
View File
@@ -369,7 +369,8 @@ func (device *Device) RoutineHandshake(id int) {
// endpoints destination address is the source of the datagram
if device.IsUnderLoad() {
disableCookies := device.disableCookies.Load()
if !disableCookies && device.IsUnderLoad() {
// verify MAC2 field
-5
View File
@@ -239,11 +239,6 @@ func (peer *Peer) SendHandshakeResponse() error {
}
func (device *Device) SendHandshakeCookie(initiatingElem *QueueHandshakeElement) error {
if device.disableCookies.Load() {
device.log.Verbosef("Sending cookie response blocked for %v due to disabled cookies", initiatingElem.endpoint.DstToString())
return nil
}
device.log.Verbosef("Sending cookie response for denied handshake message for %v", initiatingElem.endpoint.DstToString())
sender := binary.LittleEndian.Uint32(initiatingElem.packet[4:8])