]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
networking_sitnl: always return negative error code in case of failure
authorAntonio Quartulli <a@unstable.cc>
Wed, 13 Jul 2022 12:14:16 +0000 (14:14 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 13 Jul 2022 12:23:50 +0000 (14:23 +0200)
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 <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220713121416.1912-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24686.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/networking_sitnl.c

index 0944ad0a9e858f898d94339cdc1a92646bbc0476..46db23612f37710490d7cd9b481d242d7404acb1 100644 (file)
@@ -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));