summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-01-02 23:41:13 +0100
committerArne Schwabe <arne@rfc2549.org>2013-01-02 23:41:13 +0100
commit39eaf8359cfc9ab1e394a124c4aa900df83d50cd (patch)
tree06caaff1361a79c5ae19055a6689236fdbba803d
parent410900f7619be50371d2fe3163873f2422928660 (diff)
- Fix printing randomized hostname (closes issue #127)
- merge with upstream
-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