[riot-notifications] [RIOT-OS/RIOT] sock_dns: correctly report too short messages (#10896)

Kaspar Schleiser notifications at github.com
Tue Jan 29 20:34:28 CET 2019


kaspar030 commented on this pull request.



> @@ -221,8 +221,15 @@ int sock_dns_query(const char *domain_name, void *addr_out, int family)
             continue;
         }
         res = sock_udp_recv(&sock_dns, reply_buf, sizeof(reply_buf), 1000000LU, NULL);
-        if ((res > 0) && (res > (int)DNS_MIN_REPLY_LEN)) {
-            if ((res = _parse_dns_reply(reply_buf, res, addr_out, family)) > 0) {
+        if (res > 0) {
+            if (res > (int)DNS_MIN_REPLY_LEN) {
+                if ((res = _parse_dns_reply(reply_buf, res, addr_out,
+                                            family)) > 0) {
+                    goto out;
+                }
+            }
+            else {
+                res = -EBADMSG;
                 goto out;

Doesn't this stop retrying as is?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10896#pullrequestreview-197743797
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190129/fa120b71/attachment-0001.html>


More information about the notifications mailing list