]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
sitnl: fix TUN/TAP confusion in error messages
authorAntonio Quartulli <a@unstable.cc>
Sat, 18 Apr 2020 01:31:23 +0000 (03:31 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 19 Apr 2020 09:54:52 +0000 (11:54 +0200)
The is_tun_p2p() function can return false for both TAP or TUN
interfaces (under certain conditions), therefore we should not
assume any TUN/TAP type when printing related messages.

Remove reference to TUN/TAP when printing messages under conditions
based on is_tun_p2p().

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200418013123.22551-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19775.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index 79d92ea6c45156d6191cdd9ebb0583946ce10761..8e692977e9844dae4fc6ecc420d716ba715b8add 100644 (file)
@@ -1093,7 +1093,7 @@ do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,
         if (net_addr_ptp_v4_add(ctx, ifname, &tt->local,
                                 &tt->remote_netmask) < 0)
         {
-            msg(M_FATAL, "Linux can't add IP to TUN interface %s", ifname);
+            msg(M_FATAL, "Linux can't add IP to interface %s", ifname);
         }
     }
     else
@@ -1101,7 +1101,7 @@ do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,
         if (net_addr_v4_add(ctx, ifname, &tt->local,
                             netmask_to_netbits2(tt->remote_netmask)) < 0)
         {
-            msg(M_FATAL, "Linux can't add IP to TAP interface %s", ifname);
+            msg(M_FATAL, "Linux can't add IP to interface %s", ifname);
         }
     }
 #elif defined(TARGET_ANDROID)
@@ -1970,7 +1970,7 @@ undo_ifconfig_ipv4(struct tuntap *tt, openvpn_net_ctx_t *ctx)
         if (net_addr_ptp_v4_del(ctx, tt->actual_name, &tt->local,
                                 &tt->remote_netmask) < 0)
         {
-            msg(M_WARN, "Linux can't del IP from TUN iface %s",
+            msg(M_WARN, "Linux can't del IP from iface %s",
                 tt->actual_name);
         }
     }
@@ -1978,7 +1978,7 @@ undo_ifconfig_ipv4(struct tuntap *tt, openvpn_net_ctx_t *ctx)
     {
         if (net_addr_v4_del(ctx, tt->actual_name, &tt->local, netbits) < 0)
         {
-            msg(M_WARN, "Linux can't del IP from TAP iface %s",
+            msg(M_WARN, "Linux can't del IP from iface %s",
                 tt->actual_name);
         }
     }