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");
+    }
+
     if (c->c1.tuntap)
     {
         close_tun(c->c1.tuntap, &c->net_ctx);
-- 
2.30.2



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

Reply via email to