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> --- ** 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)); -- 2.35.1 _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel