summaryrefslogtreecommitdiff
path: root/openvpn/src
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
commit1b8629eab673faf76dec79fae740802a6faed9e3 (patch)
tree7ad72a45396b74a47b9046c5b97932a29097e3b9 /openvpn/src
parent601d6bdf53eafd4169d844126cd4e2c204b9e250 (diff)
- Fix printing randomized hostname (closes issue #127)
- merge with upstream
Diffstat (limited to 'openvpn/src')
-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