Author: Ricardo ManrĂ­quez <ricardo.manriq...@gmail.com>

To enable the possibility of DNS autoconfiguration the IP address and
hostname of the client are needed to register at the DNS level, this patch
adds this information when using push-peer-info.

The motivation is that the domain name is as intrusive as the MAC address
and DNS autoconfiguration is helpful to be able to communicate back to the
clients, this generates a problem when the client connects to the network
directly and then uses the VPN connection, now the DNS records do not match
and when using remote assistance or remote management tools the benefits of
DNS are negated.

Signed-off-by: Ricardo ManrĂ­quez <ricardo.manriq...@gmail.com>

---
 src/openvpn/ssl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index 80e0d5acb4..3031566585 100644
--- a/src/openvpn/ssl.c
+++ b/src/openvpn/ssl.c
@@ -2321,6 +2321,11 @@ push_peer_info(struct buffer *buf, struct
tls_session *session)
             {
                 buf_printf(&out, "IV_HWADDR=%s\n",
format_hex_ex(rgi.hwaddr, 6, 0, 1, ":", &gc));
             }
+
+            char hostname[64];
+            gethostname(hostname, 63);
+            buf_printf(&out, "IV_HOSTNAME=%s\n", hostname );
+
             buf_printf(&out, "IV_SSL=%s\n", get_ssl_library_version() );
 #if defined(_WIN32)
             buf_printf(&out, "IV_PLAT_VER=%s\n",
win32_version_string(&gc, false));
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to