From b304418d43b258d29bc301702bad39c704c39f2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Fri, 22 Jan 2016 01:47:19 -0500
Subject: [PATCH] dht: ensure search response include a token

---
 src/dht.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dht.cpp b/src/dht.cpp
index db813ae9..91d35720 100644
--- a/src/dht.cpp
+++ b/src/dht.cpp
@@ -2435,7 +2435,7 @@ Dht::processMessage(const uint8_t *buf, size_t buflen, const sockaddr *from, soc
             std::shared_ptr<Node> n;
             if (msg.tid.matches(TransPrefix::GET_VALUES, &ttid) or msg.tid.matches(TransPrefix::FIND_NODE, &ttid)) {
                 gp = ttid != 0;
-                if (gp)
+                if (gp and not msg.token.empty())
                     sr = findSearch(ttid, from->sa_family);
             }
             if (msg.nodes4.size() % 26 != 0 || msg.nodes6.size() % 38 != 0) {
-- 
GitLab