Message-ID: <50851A9A.5090902@...1227...> Date: Mon, 22 Oct 2012 12:06:18 +0200 From: Arne Schwabe MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------020000050701030105050409" Subject: Re: [Openvpn-devel] Bug in program, bug in documentation, or something else? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jonathan K. Bullard" Cc: openvpn-devel@lists.sourceforge.net This is a multi-part message in MIME format. --------------020000050701030105050409 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Am 22.10.12 00:40, schrieb Jonathan K. Bullard: > A Tunnelblick user has reported odd behavior with name resolution > failures. I can't tell if it is a bug in OpenVPN, a bug in the > documentation, or something else. The behavior is apparently the same > in OpenVPN 2.2.1 and 2.3alpha1. > > The 2.3 man page says: > > --resolv-retry n > If hostname resolve fails for --remote, retry resolve for n > seconds before failing. > Set n to "infinite" to retry indefinitely. > By default, --resolv-retry infinite is enabled. You can > disable by setting n=0. > > > But the behavior seems very different: > > If a name resolution failure (caused, for example, by losing the > network connection) occurs > and --resolv-retry is: > > 1, the first resolution failure terminates the connection; > 5, resolution attempts are made dozens of times per second, > seemingly forever; or > 10, resolution attempts are made every five seconds, seemingly > forever. > > > Any ideas if this is a program bug, a documentation bug, or something > else, for example, a problem that only occurs on OS X? I guess a programming bug. The number of retries for a resolv is defined as (fail_wait_interval is fixed to 5): int resolve_retries = (flags & GETADDR_TRY_ONCE) ? 1 : (resolve_retry_seconds / fail_wait_interval); so if resolv-retry < 5 resolve_retries is set to 0 giving you a direct failure. Without trying you should then see a USR1 and openvpn will directly do the next connection attempt without waiting the 5s delay. On a quick glance I cannot see a way to tell openvpn to have a fixed number of connection retries after it quits. Arne --------------020000050701030105050409 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Am 22.10.12 00:40, schrieb Jonathan K. Bullard:
A Tunnelblick user has reported odd behavior with name resolution failures. I can't tell if it is a bug in OpenVPN, a bug in the documentation, or something else. The behavior is apparently the same in OpenVPN 2.2.1 and 2.3alpha1.

The 2.3 man page says:
--resolv-retry n
     If hostname resolve fails for --remote, retry resolve for n seconds before failing.
     Set n to "infinite" to retry indefinitely.
     By default, --resolv-retry infinite is enabled.  You can disable by setting n=0.

But the behavior seems very different:

If a name resolution failure (caused, for example, by losing the network connection) occurs
and --resolv-retry is:
1, the first resolution failure terminates the connection;
5, resolution attempts are made dozens of times per second, seemingly forever; or
10, resolution attempts are made every five seconds, seemingly forever.

Any ideas if this is a program bug, a documentation bug, or something else, for example, a problem that only occurs on OS X?
I guess a programming bug.

The number of retries for a resolv is defined as (fail_wait_interval is fixed to 5):
      int resolve_retries = (flags & GETADDR_TRY_ONCE) ? 1 : (resolve_retry_seconds / fail_wait_interval);

so if resolv-retry < 5 resolve_retries is set to 0 giving you a direct failure. Without trying you should then see a USR1 and openvpn will directly do the next connection attempt without waiting the 5s delay.

On a quick glance I cannot see a way to tell openvpn to have a fixed number of connection retries after it quits.

Arne
--------------020000050701030105050409--