alon.barlev at gmail
Jul 4, 2012, 12:55 AM
Post #5 of 17
On Wed, Jul 4, 2012 at 10:16 AM, Alon Bar-Lev <alon.barlev [at] gmail> wrote:
Re: [PATCH] always run the vpnc-script at exit
[In reply to]
> On Wed, Jul 4, 2012 at 10:06 AM, Antonio Borneo
> <borneo.antonio [at] gmail> wrote:
>> On Wed, Jul 4, 2012 at 3:13 AM, Alon Bar-Lev <alon.barlev [at] gmail> wrote:
>>> This allows persisted tun device to be cleaned up for reuse.
>>> This is the minimal change to reach the goal using atexit(),
>>> not sure it is the best way.
>> Thanks for the patch set.
>> I do not understand the reason for adding this patch.
>> Current code in vpnc already runs close_tunnel() before exit, at least
>> in all the cases I have tested. Your patch forces running
>> close_tunnel() again for a second time.
>> Cases of abrupt crash, e.g. segmentation fault, are not handled in
>> current code neither in your patch, but such cases should be addressed
>> by fixing directly the crash issue.
>> I expect you have found some specific case in current code that fails
>> to run close_tunnel().
>> Or, the case of persistent tun device is not well cleared by current
>> close_tunnel() and you need to run it twice. In this case the right
>> target would be fixing existing code or script.
>> Could you please report the specific use case that requires this patch?
>> If you run vpnc with "--debug 2" you will get message
>> S8 close_tunnel
>> right before close_tunnel() is executed by existing code.
>> This could help you to narrow the search.
>> Best Regards,
>> Antonio Borneo
> Oh... I am so sorry!
> The reason for this patch is if the vpnc exists because of error(),
> for example, the wlan interface is restarted or any other error with
> Calling error() at any point in code simply quits without proper cleanup.
> The complex solution is to modify error() to properly terminate the
> application including any cleanup code.
> The simplest solution would be to use the atexit() to achieve more or
> less the same.
> It is true that in case of normal exit, the cleanup code will be
> called too, I need to fix this one.
More specific example, when LAN interface is restarted:
vpnc-devel mailing list
vpnc-devel [at] unix-ag