From 9eeeb38c45b99570827597433617b2ce24a9b87f Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Fri, 8 Mar 2024 01:57:25 +0100 Subject: [PATCH] unit-test: fix sitnl systematic failure It was noted that the SITNL unit test is always failing for no clear reason. It turned out that commit 22ba196429cf480c7e6f56d5c2781849b975d124 ("SITNL: revert change of sitnl_send return type, return int"), that was supposed to be a simple revert of ae663c573a15844f661648cb4e021af25787652c ("Using new numeric conversion tools") is actually converting two "return ret" into return -1 and return -EINVAL accordingly. This accidental change results in two functions always returning an error despite terminating succesfully. This behaviour was obviously fooling the unitest which failed in result. Fix both functions by properly returning "ret" as it was originally. Signed-off-by: Antonio Quartulli --- openvpn/tun/linux/client/sitnl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn/tun/linux/client/sitnl.hpp b/openvpn/tun/linux/client/sitnl.hpp index 5a9ae977..d896d6ce 100644 --- a/openvpn/tun/linux/client/sitnl.hpp +++ b/openvpn/tun/linux/client/sitnl.hpp @@ -823,7 +823,7 @@ class SITNL /* for SITNL_ADDATTR */ err: - return -EINVAL; + return ret; } static int @@ -933,7 +933,7 @@ class SITNL /* for SITNL_ADDATTR */ err: - return -1; + return ret; } static int