From 52c7db0d9406e9832fc32055f0a090f10d1bc279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Bo=C4=8Dek?= Date: Mon, 8 Jul 2024 19:14:51 +0200 Subject: [PATCH] fix: rbdns loop --- library.json | 2 +- src/rbdns.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library.json b/library.json index e6c9593..ec43b1d 100644 --- a/library.json +++ b/library.json @@ -14,7 +14,7 @@ "maintainer": true } ], - "version": "14.0.0", + "version": "14.0.1", "frameworks": ["espidf", "arduino"], "platforms": "espressif32" } diff --git a/src/rbdns.cpp b/src/rbdns.cpp index 2d10b16..aa3ce91 100644 --- a/src/rbdns.cpp +++ b/src/rbdns.cpp @@ -1,8 +1,8 @@ #include "lwip/err.h" #include "lwip/sockets.h" #include "lwip/sys.h" -#include #include +#include #include "rbdns.h" #include "rbwifi.h" @@ -63,7 +63,7 @@ void DnsServer::start(const char* local_hostname, std::function get_ m_local_hostname = local_hostname; m_get_local_ip = get_local_ip; - if(!m_get_local_ip) { + if (!m_get_local_ip) { m_get_local_ip = &rb::WiFi::getIp; } @@ -120,7 +120,7 @@ ssize_t DnsServer::receivePacket(std::vector& buff, struct sockaddr_in* return -1; } - if (msg_size < buff.size() || msg_size > DNS_MSG_SIZE_LIMIT) + if (msg_size <= buff.size() || msg_size > DNS_MSG_SIZE_LIMIT) break; buff.resize(msg_size); }