From patchwork Fri Apr 17 15:31:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1090 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.27.255.57]) by backend30.mail.ord1d.rsapps.net with LMTP id sAt1BqZYml6EXgAAIUCqbw for ; Fri, 17 Apr 2020 21:32:22 -0400 Received: from proxy15.mail.iad3a.rsapps.net ([172.27.255.57]) by director10.mail.ord1d.rsapps.net with LMTP id iEYeBKZYml6UXwAApN4f7A ; Fri, 17 Apr 2020 21:32:22 -0400 Received: from smtp10.gate.iad3a ([172.27.255.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3a.rsapps.net with LMTP id SFXwOqVYml4zYwAAHi9b9g ; Fri, 17 Apr 2020 21:32:21 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp10.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 729bbfe2-8114-11ea-82fd-525400a8203f-1-1 Received: from [216.105.38.7] ([216.105.38.7:47058] helo=lists.sourceforge.net) by smtp10.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id CB/44-17034-5A85A9E5; Fri, 17 Apr 2020 21:32:21 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jPcKd-0002jn-83; Sat, 18 Apr 2020 01:31:43 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jPcKb-0002jb-K9 for openvpn-devel@lists.sourceforge.net; Sat, 18 Apr 2020 01:31:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QWQ7q1TxifGbh7YL/71aCnAA3iGri3VdRVUJTXmx+Fk=; b=m936XWDbhYRd1ngSgMzZpftsgn NoVBTV8kMrIjkpNQz8v9ysHgKZHBSwdHJbZL8NExx7DWS/ilYy4qodIDawF8RJEgH2WPkpUviMI6k gbPRW8rH5XhaoG3G6b8OoKB0PUCDEf2swCkmn5btSLKvtinwAS1FvWplkkkmBtsUfZR0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=QWQ7q1TxifGbh7YL/71aCnAA3iGri3VdRVUJTXmx+Fk=; b=V yrEm0abj+6H8ENKeg0mWZ2R/alzQ5s+4jOdQUXx7pVprx1aARiaq7fTmlZFkKE760GrrvcADyM+Sn X+coPC+audrc1yLSxXCei8qdSXXSBvDDcUIV9k6YP0OMpzVHAIv4QhaJ5AtOFTyiIFHa0OSjhebwm cIG1RCaNI34BQh5o=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jPcKa-005qq7-8u for openvpn-devel@lists.sourceforge.net; Sat, 18 Apr 2020 01:31:41 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 18 Apr 2020 03:31:23 +0200 Message-Id: <20200418013123.22551-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: unstable.cc] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1jPcKa-005qq7-8u Subject: [Openvpn-devel] [PATCH] sitnl: fix TUN/TAP confusion in error messages X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 Acked-by: Gert Doering --- src/openvpn/tun.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 79d92ea6..8e692977 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -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); } }