Skip to contentSkip to conversation

networking_sitnl: always return negative error code in case of failure

PATCH In review Antonio Quartulli 2 participants 2 messages Jul 13, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 networking_sitnl: always return negative error code in case of failure

The API is designed to always return a negative error code in case of failure, therefore we should return '-errno' when ifindex has failed.

---

** This patch should also go to 2.5 **

 src/openvpn/networking_sitnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/networking_sitnl.c +1 -1
index 0944ad0a..46db2361 100644
@@ -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));
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#1 lore raw

"obvious in hindsight" :-)

Your patch has been applied to the master branch.

Not applicable to 2.5, as there is no net_iface_del() yet.

commit dab9343a0530ee2468304823181372393d365675 (HEAD -> master)

Author: Antonio Quartulli
Date:   Wed Jul 13 14:14:16 2022 +0200
     networking_sitnl: always return negative error code in case of failure

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24686.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering