[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Hibernate mode problem - MacOS X


  • Subject: Re: [Openvpn-users] Hibernate mode problem - MacOS X
  • From: James Yonan <jim@xxxxxxxxx>
  • Date: Sun, 12 Dec 2004 22:24:20 -0700 (MST)

On Sun, 12 Dec 2004, Steven Palm wrote:

> 
> On Sun, 12 Dec 2004, Steven Palm wrote:
> > On Dec 12, 2004, at 4:27 AM, James Yonan wrote:
> >> The other change is the ability to have OpenVPN hibernate on startup
> >> until it gets a "go" signal from the management interface.  This was
> >> requested by several people.  It can also be used to "pause" and
> >> "resume" the tunnel from the management interface.
> >
> > Brilliant!  However, I can't get it to work here.... If I put
> > management-hold in my config file, the openvpn command starts up in a
> > hibernate mode, but when I connect to the management port, I don't get
> > the management port header stuff echoed to me, and it doesn't respond 
> > to
> > any commands.  Turning off the hold feature allows the management port
> > to work here again.
> >
> > Anyone else seeing this, or is it just me?  Running on MacOS X if it
> > matters...
> 
>   Drats...  :-(
> 
>   Upon startup, all I see as output is the initial line:
> 
> Sun Dec 12 20:06:44 2004 OpenVPN 2.0_rc2 powerpc-apple-darwin7.6.0 
> [SSL] [LZO] built on Dec 12 2004
> 
>   Nothing more, even though I have the config set to "verb 99" to get as 
> much output as possible.
> 
>   Trying to telnet to the session opens it, echoes what I type, but does 
> nothing with it:
> 
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> status
> help
> hold off
> 
>   Any idea where to start poking at the source to try to nail this down?

Interestingly enough, you've found 2 completely unrelated bugs.

The first one is that --verb 99 doesn't show very much debugging info.  
That's because a recent change (in the late 2.0 betas) created a bug which
ignores verb value settings >= 16.  I will fix this for rc3, but for now
just don't use --verb values higher than 15.  You shouldn't need to
because (right now) OpenVPN doesn't define any verb levels higher than 11.

The second bug is interesting because it normally only occurs on OS X.  I
was able to reproduce it on Linux by defining SELECT_PREFERRED_OVER_POLL
in event.c.  The bug is in the new management code, but is subtle because
only the select() code in event.c will reveal it.  Right now, OS X is the 
only OS among the 7 which OpenVPN supports which favors the select() 
syscall for I/O waits.  All the other *nixes favor poll(), which 
doesn't reveal the bug, so this one sort of slipped through the 
cracks.  I've attached a patch.

James
--- openvpn-2.0_rc2/manage.c	2004-12-11 19:01:33.000000000 -0600
+++ openvpn-2.0_rc2a/manage.c	2004-12-12 22:29:17.000000000 -0600
@@ -1549,10 +1549,10 @@
   
   if (man_standalone_ok (man))
     {
-      event_reset (man->connection.es);
-      management_socket_set (man, man->connection.es, NULL, NULL);
       do
 	{
+	  event_reset (man->connection.es);
+	  management_socket_set (man, man->connection.es, NULL, NULL);
 	  tv.tv_usec = 0;
 	  tv.tv_sec = 1;
 	  status = event_wait (man->connection.es, &tv, &esr, 1);