Hi,

On Thu, Aug 18, 2022 at 02:13:58AM +0200, Antonio Quartulli wrote:
> When closing the tunnel interface we know if we were using DCO or not.
> for this reason we can customize the closing message and make it
> consistent with the opening one.
> 
> Signed-off-by: Antonio Quartulli <a...@unstable.cc>
> ---
>  src/openvpn/init.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/openvpn/init.c b/src/openvpn/init.c
> index e8335c53..92c4cab9 100644
> --- a/src/openvpn/init.c
> +++ b/src/openvpn/init.c
> @@ -1921,7 +1921,15 @@ do_open_tun(struct context *c)
>  static void
>  do_close_tun_simple(struct context *c)
>  {
> -    msg(D_CLOSE, "Closing TUN/TAP interface");
> +    if (dco_enabled(&c->options))
> +    {
> +        msg(D_CLOSE, "Closing DCO interface");
> +    }
> +    else
> +    {
> +        msg(D_CLOSE, "Closing TUN/TAP interface");
> +    }

I find this is a bit excessive in lines of code...  

If we really want this, I think we should do

 +    msg(D_CLOSE, "Closing %s interface",
          dco_enabled(&c->options)? "DCO": "TUN/TAP");

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

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to