Windows client do not send local computer name and the server assumes
default "localhost" if not forced by command line option. This
prevents server scripts to run that somehow depend on the DNS name of
the connected system. (like updating DNS records when a new VPN client
connects)
This is my first patch/email so I can easily make something wrong.

--- main.c.orig 2024-12-07 23:42:09.019346300 +0300
+++ main.c      2024-12-07 20:01:08.708405000 +0300
@@ -1789,6 +1789,11 @@ int main(int argc, char *argv[])
        vpninfo->cbdata = vpninfo;
 #ifdef _WIN32
        set_default_vpncscript();
+       TCHAR buffer[256] = TEXT("");
+       DWORD dwSize = _countof(buffer);
+       if (GetComputerNameEx(
ComputerNamePhysicalDnsHostname, buffer, &dwSize)) {
+               openconnect_set_localname(vpninfo, buffer);
+       }
 #else
        vpninfo->use_tun_script = 0;
        vpninfo->uid = getuid();

Signed-off-by: Alexey Smirnov <ramyale...@gmail.com>

_______________________________________________
openconnect-devel mailing list
openconnect-devel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/openconnect-devel

Reply via email to