Skip to content

Commit

Permalink
unit-test: fix sitnl systematic failure
Browse files Browse the repository at this point in the history
It was noted that the SITNL unit test is always failing for no clear
reason.

It turned out that commit 22ba196
("SITNL: revert change of sitnl_send return type, return int"),
that was supposed to be a simple revert of
ae663c5 ("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 <antonio@openvpn.net>
  • Loading branch information
ordex authored and dsommers committed Mar 12, 2024
1 parent 8c007de commit 9eeeb38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openvpn/tun/linux/client/sitnl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ class SITNL

/* for SITNL_ADDATTR */
err:
return -EINVAL;
return ret;
}

static int
Expand Down Expand Up @@ -933,7 +933,7 @@ class SITNL

/* for SITNL_ADDATTR */
err:
return -1;
return ret;
}

static int
Expand Down

0 comments on commit 9eeeb38

Please sign in to comment.