From patchwork Wed Jul 13 02:14:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2588 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id MC+YNRS4zmLxeAAAIUCqbw (envelope-from ) for ; Wed, 13 Jul 2022 08:18:28 -0400 Received: from proxy13.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id AN6RNRS4zmK8BAAApN4f7A (envelope-from ) for ; Wed, 13 Jul 2022 08:18:28 -0400 Received: from smtp25.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy13.mail.iad3b.rsapps.net with LMTPS id uNbTLhS4zmKZFwAAvUvv+w (envelope-from ) for ; Wed, 13 Jul 2022 08:18:28 -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: smtp25.gate.iad3b.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: e671686c-02a5-11ed-be4f-52540030a522-1-1 Received: from [216.105.38.7] ([216.105.38.7:59364] helo=lists.sourceforge.net) by smtp25.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 5D/5D-17465-418BEC26; Wed, 13 Jul 2022 08:18:28 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1oBbJ7-0000Tv-Se; Wed, 13 Jul 2022 12:17:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oBbIi-0000Bs-M5 for openvpn-devel@lists.sourceforge.net; Wed, 13 Jul 2022 12:17:08 +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=Lkfwc3zGb8gt5BJTmc6W9KUPq0kiAelIY4cVUrOgotA=; b=fuzbbUclOZIYzTHQpEdRXTRP8t BC5ujXUfJSrnSidB0PI7/SN63CZMyEdHChPKHEYG+SRtu2BzpPQvDWYpBVUXvVzEihvjwJcDNbErP //jin9+lmbhiKssI9gOPFIPnna0N9DsAmJAAMUbTnli8S7scgOk5dmojqyhY+CdTaz64=; 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=Lkfwc3zGb8gt5BJTmc6W9KUPq0kiAelIY4cVUrOgotA=; b=a gOot4iBfEknXdcbOyrXfmnFe4Yg0IdilpswE0pi0dGt3I9hmxPcLzdxZH34VQZKiQcJCNJ4TxpiUE SGj48uG5offN6M7lQobW/XoNnRiA3nInlUz9l8vWuqsFX9sR5/OKfCeFmEhbkFL/4fReEajVxXt2K l2KFHbxIj3+8MlEw=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oBbIY-00FdhP-Ul for openvpn-devel@lists.sourceforge.net; Wed, 13 Jul 2022 12:16:59 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Jul 2022 14:14:16 +0200 Message-Id: <20220713121416.1912-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The API is designed to always return a negative error code in case of failure, therefore we should return '-errno' when ifindex has failed. Signed-off-by: Antonio Quartulli --- ** This patch should also go to 2.5 ** Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1oBbIY-00FdhP-Ul Subject: [Openvpn-devel] [PATCH] networking_sitnl: always return negative error code in case of failure 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 API is designed to always return a negative error code in case of failure, therefore we should return '-errno' when ifindex has failed. Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- ** This patch should also go to 2.5 ** src/openvpn/networking_sitnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index 0944ad0a..46db2361 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -1374,7 +1374,7 @@ net_iface_del(openvpn_net_ctx_t *ctx, const char *iface) if (!ifindex) { - return errno; + return -errno; } req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.i));