mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-02 21:36:06 +03:00
fix: disable the whole underload if DisableCookies is on
Thanks to @darkk for spotting and suggesting the fix
This commit is contained in:
1 parent
da11c9fadc
commit
b5928efb6c
2 files changed
+2
-6
No files matched your search
+2
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in new issue
Block a user