[Openvpn-devel] Drop EAI_NODATA, absent on FreeBSD and obsoleted by RFC3493

Message ID 20201204155516.10267-1-themiron@yandex-team.ru
State Superseded
Headers show
Series [Openvpn-devel] Drop EAI_NODATA, absent on FreeBSD and obsoleted by RFC3493 | expand

Commit Message

Vladislav Grishenko Dec. 4, 2020, 4:55 a.m. UTC
---
 src/openvpn/socket.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

Patch

diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index bd085e8f..31e8fe9a 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -625,10 +625,8 @@  query_servinfo(const char *domain, int proto,
             break;
 
         case DNS_ERROR_RCODE_NAME_ERROR:
-            return EAI_NONAME; /* HOST_NOT_FOUND */
-
         case DNS_INFO_NO_RECORDS:
-            return EAI_NODATA; /* NO_DATA */
+            return EAI_NONAME; /* HOST_NOT_FOUND */
 
         case DNS_ERROR_NO_DNS_SERVERS:
         case DNS_ERROR_RCODE_FORMAT_ERROR:
@@ -642,7 +640,7 @@  query_servinfo(const char *domain, int proto,
             return EAI_AGAIN; /* TRY_AGAIN */
 
         default:
-            return EAI_NODATA;
+            return EAI_FAIL;
     }
 
     struct servinfo *list = NULL, *first = NULL;
@@ -682,7 +680,7 @@  query_servinfo(const char *domain, int proto,
     }
     else
     {
-        status = EAI_NODATA;
+        status = EAI_FAIL;
     }
 
 done:
@@ -717,13 +715,11 @@  query_servinfo(const char *domain, int proto,
         switch (h_errno)
         {
             case HOST_NOT_FOUND:
-                return EAI_NONAME;
-
             case NO_ADDRESS:
 #if NO_ADDRESS != NO_DATA
             case NO_DATA:
 #endif
-                return EAI_NODATA;
+                return EAI_NONAME;
 
             case NO_RECOVERY:
                 return EAI_FAIL;
@@ -782,7 +778,7 @@  query_servinfo(const char *domain, int proto,
     }
     else
     {
-        status = EAI_NODATA;
+        status = EAI_FAIL;
     }
 
 done: