Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an exit-event to stop openvpn instead of killing it #1

Closed
wants to merge 2 commits into from

Conversation

selvanair
Copy link

For previous discussion on this topic see here

@mattock: Thanks for testing. The main improvement I see is that log file is not anymore incomplete on exit. Tearing down routes is nice too, but at least for ipv4 it seems routes do disappear even otherwise when the tunnel goes down. Sending exit notifies with --explicit-exit-notify also works now.

Note: The last fixup commit is squashed down for ease of review.

Currently openvpn is stopped by killing the process causing
potential truncation of log messages, client not sending
exit-notify to the server etc. Using an exit-event provides
a way to cleanly stop the process.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Fix delay in log file updates and missing log messages
on exit. Also simplifies the code as the timer used to periodically
trigger flushing is no more needed.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
@mattock
Copy link
Member

mattock commented Nov 15, 2016

@selvanair: I found about the lack of exit-events in openvpnserv2 when running my Powershell testsuite against the t_client servers that also setup IPv6 routes. I noticed that the first IPv6 ping tests always succeeded, but all subsequent ones failed. I did not debug the problem, but some netsh calls were failing. Possibly the default IPv6 route was left behind, and further netsh calls to add a different default route failed. This is clearly a bug that we should be fixed. Interestingly the problem manifested itself only when testing with openvpnserv2, not when running OpenVPN from cmd.exe or via openvpn-gui.exe. I was unable to break IPv4 connectivity despite brutally killing openvpn processes on the fly without notice, so the problem seems limited to IPv6.

Anyways, I will have a look at the C# code today, so that we can get this into 2.4_beta1 due on Wednesday.

@mattock
Copy link
Member

mattock commented Nov 15, 2016

The code changes look reasonable, but my experience with C# in general and Windows programming in particular is fairly limited. I'll send email to openvpn-devel to see if somebody with more experience would volunteer to review this PR.

@mattock
Copy link
Member

mattock commented Nov 16, 2016

So far no response from any C# developers on openvpn-devel list. I would be inclined to merge this just before 2.4_beta1 if nobody has done the review by then.

FYI: the related IPv6 route setup bug has now been reported here.

@cron2
Copy link

cron2 commented Nov 16, 2016

Hi,

On Wed, Nov 16, 2016 at 12:43:52AM -0800, Samuli Seppänen wrote:

So far no response from any C# developers on openvpn-devel list. I would be inclined to merge this just before 2.4_beta1 if nobody has done the review by then.

I'm not sure there is any other C# developer than you... :-/

What about the original author? Maybe he could have a look?

gert

USENET is not the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany gert@greenie.muc.de
fax: +49-89-35655025 gert@net.informatik.tu-muenchen.de

@mattock
Copy link
Member

mattock commented Nov 16, 2016

@cron2 : I can poke at xkjyeah (the original author). Chipitsine also does C#. I also believe SviMik is a Windows dev, but he has not been around that much lately.

@mattock
Copy link
Member

mattock commented Nov 16, 2016

I asked xkjyeah if he could do the review.

@xkjyeah
Copy link

xkjyeah commented Nov 16, 2016

Whoa. That's highly dubious (the use of native C system calls). I cannot test a build, but I'm going to propose some changes

@xkjyeah
Copy link

xkjyeah commented Nov 16, 2016

Differences between Selva's version and mine. Syntactically they look like a 1-for-1 translation, but I'm not sure if the semantics are the same. Testers, anyone?

selvanair/openvpnserv2@exit-event-v2...xkjyeah:exit-event-v2

@mattock
Copy link
Member

mattock commented Nov 21, 2016

@selvanair : this PR can be closed, right?

@selvanair
Copy link
Author

Closing as PR #2 replaces this.

@selvanair selvanair closed this Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants