diff options
author | JuanJo Ciarlante <juanjosec@gmail.com> | 2011-03-25 14:51:33 +0100 |
---|---|---|
committer | JuanJo Ciarlante <juanjosec@gmail.com> | 2011-03-27 23:40:33 +0200 |
commit | 86093c1cb434f448253cc8c7da4481dca320cafc (patch) | |
tree | 7fb01515b7e68a56b7efbf3b5f1ddc157131870e | |
parent | * ipv6-0.4.15: add --multihome support to xBSD (diff) | |
download | openvpn-86093c1cb434f448253cc8c7da4481dca320cafc.tar.xz |
* ipv6-0.4.15b: rebase over openvpn-testing-master
-rw-r--r-- | README.ipv6 | 4 | ||||
-rw-r--r-- | options.c | 1 | ||||
-rw-r--r-- | socket.c | 26 |
3 files changed, 17 insertions, 14 deletions
diff --git a/README.ipv6 b/README.ipv6 index 5d17b91..4295f85 100644 --- a/README.ipv6 +++ b/README.ipv6 @@ -1,4 +1,4 @@ -[ Last updated: 16-Nov-2009. ] +[ Last updated: 25-Mar-2011. ] OpenVPN-2.1 over UDP6/TCP6 README for ipv6-0.4.x patch releases: ( --udp6 and --tcp6-{client,server} ) @@ -18,7 +18,7 @@ OpenVPN-2.1 over UDP6/TCP6 README for ipv6-0.4.x patch releases: * Status: o OK: - - upd6,tcp6: GNU/Linux, win32, openbsd-4.6 + - upd6,tcp6: GNU/Linux, win32, openbsd-4.7, freebsd-8.1 - udp4->upd6,tcp4->tcp6 (ipv4/6 mapped): GNU/Linux (gives a warning on local!=remote proto matching) o NOT: @@ -79,6 +79,7 @@ const char title_string[] = #endif #ifdef ENABLE_EUREPHIA " [eurephia]" +#endif #ifdef ENABLE_IP_PKTINFO " [MH]" #endif @@ -52,12 +52,13 @@ const int proto_overhead[] = { /* indexed by PROTO_x */ * Convert sockflags/getaddr_flags into getaddr_flags */ static unsigned int -sf2gaf(unsigned int getaddr_flags, +sf2gaf(const unsigned int getaddr_flags, const unsigned int sockflags) { - getaddr_flags |= (sockflags & SF_GETADDRINFO_DGRAM) ? GETADDR_DGRAM : 0; - getaddr_flags |= (sockflags & SF_HOST_RANDOMIZE) ? GETADDR_RANDOMIZE : 0; - return getaddr_flags; + if (sockflags & SF_HOST_RANDOMIZE) + return getaddr_flags | GETADDR_RANDOMIZE; + else + return getaddr_flags; } /* @@ -2440,11 +2441,11 @@ print_sockaddr_ex (const struct openvpn_sockaddr *addr, { const int port= ntohs (addr->addr.in4.sin_port); buf_puts (&out, "[AF_INET]"); - mutex_lock_static (L_INET_NTOA); - buf_puts (&out, (addr_is_defined ? inet_ntoa (addr->addr.in4.sin_addr) : "[undef]")); - mutex_unlock_static (L_INET_NTOA); - if (((flags & PS_SHOW_PORT) || (addr_is_defined && (flags & PS_SHOW_PORT_IF_DEFINED))) + if (!(flags & PS_DONT_SHOW_ADDR)) + buf_printf (&out, "%s", (addr_defined (addr) ? inet_ntoa (addr->addr.in4.sin_addr) : "[undef]")); + + if (((flags & PS_SHOW_PORT) || (addr_defined (addr) && (flags & PS_SHOW_PORT_IF_DEFINED))) && port) { if (separator) @@ -2590,9 +2591,7 @@ setenv_sockaddr (struct env_set *es, const char *name_prefix, const struct openv else openvpn_snprintf (name_buf, sizeof (name_buf), "%s", name_prefix); - mutex_lock_static (L_INET_NTOA); setenv_str (es, name_buf, inet_ntoa (addr->addr.in4.sin_addr)); - mutex_unlock_static (L_INET_NTOA); if ((flags & SA_IP_PORT) && addr->addr.in4.sin_port) { @@ -2607,8 +2606,11 @@ setenv_sockaddr (struct env_set *es, const char *name_prefix, const struct openv buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); setenv_str (es, name_buf, buf); - openvpn_snprintf (name_buf, sizeof (name_buf), "%s_port", name_prefix); - setenv_int (es, name_buf, ntohs (addr->addr.in6.sin6_port)); + if ((flags & SA_IP_PORT) && addr->addr.in6.sin6_port) + { + openvpn_snprintf (name_buf, sizeof (name_buf), "%s_port", name_prefix); + setenv_int (es, name_buf, ntohs (addr->addr.in6.sin6_port)); + } break; } #endif |