Skip to contentSkip to conversation

Windows, OpenVPN-GUI, disconnect

Openvpn-devel Gert Doering 3 participants 5 messages Mar 17, 2010 – Mar 18, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

can one of you tell me what happens "under the hood" if I click the "disconnect" button of the openvpn-gui under Windows XP?

Why am I asking? I managed to get my windows build environment working well enough that I can now build a complete installer package with the IPv6 patches, and with the adapted tun/tap driver - but it breaks in funny ways.

- Installation works fine
- running the openvpn-gui (precompiled) works fine
- (client) connection to a TUN server works fine [initiated by pressing the "connect..." button of the GUI in the windowsstatus bar]
- IPv4 and IPv6 connectivity works

- pressing the "disconnection" button of the GUI doesn't seem to do anything. Well, the status window says "disconnecting..." and the button is greyed out - but no update in the log file or the status window, no nothing.

I assume that "something is miscompiled" or "a newer version of mingw has some surprising side effects" - but to know where to start looking, it would be helpful to understand what signalling is used

openvpn-gui --> openvpn.exe

to signal disconnect.

(Since I didn't touch any of the signal handling stuff, I'm fairly sure that it wasn't one of my changes, but I still want to have a working Windows bundle to get people to test it)

thanks,

gert

PS: the TAP driver changes have been successfully tested on 3 different WinXP systems now. Win7 doesn't work "as is", as it requires a signed driver.

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#1 lore raw

Hi Gert,

Quoted 26 lines · Gert Doering

Hi,

can one of you tell me what happens "under the hood" if I click the "disconnect" button of the openvpn-gui under Windows XP?

Why am I asking? I managed to get my windows build environment working well enough that I can now build a complete installer package with the IPv6 patches, and with the adapted tun/tap driver - but it breaks in funny ways.

- Installation works fine
- running the openvpn-gui (precompiled) works fine
- (client) connection to a TUN server works fine [initiated by pressing the "connect..." button of the GUI in the windowsstatus bar]
- IPv4 and IPv6 connectivity works

- pressing the "disconnection" button of the GUI doesn't seem to do anything. Well, the status window says "disconnecting..." and the button is greyed out - but no update in the log file or the status window, no nothing.

I assume that "something is miscompiled" or "a newer version of mingw has some surprising side effects" - but to know where to start looking, it would be helpful to understand what signalling is used

Quoted 8 lines

openvpn-gui --> openvpn.exe

to signal disconnect.

(Since I didn't touch any of the signal handling stuff, I'm fairly sure that it wasn't one of my changes, but I still want to have a working Windows bundle to get people to test it)

took me a while to figure this one out:
the openvpn gui codes sets an 'exit event' (using a win32 API call CreateEvent) before starting the actual openvpn process; when the user chooses 'disconnect' this 'exit event' is triggered, which causes the process to be terminated (using the appropriate win32 signal).

The question now becomes: what does openvpn do when it receives a terminate signal? actually, is there a signal being sent to the server to say "client X is disconnecting" ?

cheers,

JJK

#2 lore raw

Hi,

Quoted 5 lines · Jan Just Keijser

took me a while to figure this one out:
the openvpn gui codes sets an 'exit event' (using a win32 API call CreateEvent) before starting the actual openvpn process; when the user chooses 'disconnect' this 'exit event' is triggered, which causes the process to be terminated (using the appropriate win32 signal).

Huh, scary stuff.

How would that win32 signal be delivered to the openvpn.exe process? Will it just receive a unix-like signal "SIGTERM"? Or does it have to poll some sort of Windows event queue?

BTW: I just discovered that this is not limited to the openvpn.exe I built *on* windows, but that my linux-mingw crosscompiled openvpn.exe does this as well now, and so does the original OpenVPN-provided 2.1.1 binary(!). "Something weird happened to this machine", and I don't understand what it is.

Quoted 3 lines

The question now becomes: what does openvpn do when it receives a terminate signal? actually, is there a signal being sent to the server to say "client X is disconnecting" ?

Nothing whatsoever visible in the logs. The last entry in the log (verb 5) is after successful startup:

"Initialization Sequence Complete"

... and then when pressing <disconnect>, nothing whatsoever happens.

The OpenVPN connection stays alive and healthy(!), packets continue to get forwarded, just the signal delivery fails.

(If I increase the log verbosity to "verb 9", lots of stuff is going on, but nothing in there that gives any indication of signals being received)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#3 lore raw

On win7 with baloontips disabled you can connect but can't disconnect via the gui. Maybe that's your problem?

Am 18.03.2010 14:17, schrieb Gert Doering:

Quoted 45 lines

Hi,

Quoted 6 lines · Jan Just Keijser

took me a while to figure this one out:
the openvpn gui codes sets an 'exit event' (using a win32 API call CreateEvent) before starting the actual openvpn process; when the user chooses 'disconnect' this 'exit event' is triggered, which causes the process to be terminated (using the appropriate win32 signal).

Huh, scary stuff.

How would that win32 signal be delivered to the openvpn.exe process? Will it just receive a unix-like signal "SIGTERM"? Or does it have to poll some sort of Windows event queue?

BTW: I just discovered that this is not limited to the openvpn.exe I built *on* windows, but that my linux-mingw crosscompiled openvpn.exe does this as well now, and so does the original OpenVPN-provided 2.1.1 binary(!). "Something weird happened to this machine", and I don't understand what it is.

Quoted 4 lines

The question now becomes: what does openvpn do when it receives a terminate signal? actually, is there a signal being sent to the server to say "client X is disconnecting" ?

Nothing whatsoever visible in the logs. The last entry in the log (verb 5) is after successful startup:

"Initialization Sequence Complete"

... and then when pressing<disconnect>, nothing whatsoever happens.

The OpenVPN connection stays alive and healthy(!), packets continue to get forwarded, just the signal delivery fails.

(If I increase the log verbosity to "verb 9", lots of stuff is going on, but nothing in there that gives any indication of signals being received)

gert

#4 lore raw

Hi,

Quoted 3 lines · Eike Lohmann

On win7 with baloontips disabled you can connect but can't disconnect via the gui.
Maybe that's your problem?

Now that's an interesting information.

I'm on WinXP, so it's not the same issue - but to see someone else having problems with "disconnect" is interesting, so it might not be related to my build at all.

Mmmh. More testing. All this on WXP with the latest updates installed.

a) remove all OpenVPN stuff, reboot, reinstall unmodified 2.1.1

    -> connect/disconnect works fine

b) from there, deltapall / addtap the IPv6 capable tap driver, but stil use all the unmodified .exe
-> connect/disconnect works fine

c) reboot, try again (unmodified .exe, IPv6-capable tap driver)

    -> connect/disconnect works fine

d) replace openvpn.exe + SSL DLLs with compiled-on-mingw/linux IPv6-capable binaries, connect to IPv4-only tunnel server -> connect fine/disconnect FAIL

e) copy unmodified binaries + DLL back

    -> connect/disconnect works fine

f) replace openvpn.exe with compiled-on-mingw/windows IPv6-capable binary, connect to IPv4-only tunnel server
-> connect fine/disconnect FAIL

... so it's definitely something in the binaries that I have built that makes disconnect fail, but it doesn't matter whether I compile the binary on Linux or on Windows.

It's *not* related to TAP-driver changes (which is an important bit).

When running openvpn.exe from the "cmd.exe" command line, it does not matter which binary I am using - "ctrl-c" never does anything, and "F4" always causes a clean shutdown.

Weird, this.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...