summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openvpn/src/openvpn/socket.c7
-rw-r--r--openvpn/src/openvpn/socket.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/openvpn/src/openvpn/socket.c b/openvpn/src/openvpn/socket.c
index 9a33197c..47329ddf 100644
--- a/openvpn/src/openvpn/socket.c
+++ b/openvpn/src/openvpn/socket.c
@@ -148,6 +148,9 @@ openvpn_getaddrinfo (unsigned int flags,
ASSERT (hostname || servname);
ASSERT (!(flags & GETADDR_HOST_ORDER));
+ if (hostname && (flags & GETADDR_RANDOMIZE))
+ hostname = hostname_randomize(hostname, &gc);
+
if(hostname)
print_hostname = hostname;
else
@@ -158,10 +161,6 @@ openvpn_getaddrinfo (unsigned int flags,
else
print_servname = "";
-
- if (flags & GETADDR_RANDOMIZE)
- hostname = hostname_randomize(hostname, &gc);
-
if (flags & GETADDR_MSG_VIRT_OUT)
msglevel |= M_MSG_VIRT_OUT;
diff --git a/openvpn/src/openvpn/socket.h b/openvpn/src/openvpn/socket.h
index b30a1bc7..1a6d7c32 100644
--- a/openvpn/src/openvpn/socket.h
+++ b/openvpn/src/openvpn/socket.h
@@ -241,7 +241,11 @@ struct link_socket
#if PASSTOS_CAPABILITY
/* used to get/set TOS. */
+#if defined(TARGET_LINUX)
uint8_t ptos;
+#else /* all the BSDs, Solaris, MacOS use plain "int" -> see "man ip" there */
+ int ptos;
+#endif
bool ptos_defined;
#endif