Hi,

On Wed, Jun 13, 2018 at 04:12:17PM +0800, Antonio Quartulli wrote:
> From: Antonio Quartulli <anto...@openvpn.net>
> 
> This patch is a small "logic restyle" which basically moves the
> check for "tt != NULL" outside of the various close_tun()
> implementations and replaces it with an ASSERT.
> 
> This way the check is done only once and the function can rely
> on the assumption that "tt" is always valid.
> 
> This change is mainly to improve the code style inside close_tun()
> implementations by removing one level of indentation.
> 
> No functional change is present.

Mostly-ACK-but :-)

The changes look good.  It won't apply after the gc_arena-fixed 1/3 of
this series, so we need a new one.

I've applied the patch and checked with "git diff -w", and it does what
it says on the lid...

Not sure the ASSERT(tt) is needed in solaris_error_close() - tt can
never be NULL there (because all the caller functions are working with
an active tt).  So I'd tend to leave that out, it's not doing something 
useful.


In those close_tun() instances where you removed the

else if (tt)
{

}

part - some of them had a comment ("/* close and destroy */").  Maybe
keep the comment?

As in

     if (tt->persistent_if)        /* keep pre-existing if around */
     {
         close_tun_generic(tt);
         free(tt);
         return;
     }

     /* close and destroy */            <<<<< this one
     struct argv argv = argv_new();

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to