]> git.ipfire.org Git - thirdparty/openvpn.git/commit
sitnl: fix failure reporting by keeping error negative
authorAntonio Quartulli <a@unstable.cc>
Sat, 18 Apr 2020 01:18:49 +0000 (03:18 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 19 Apr 2020 09:50:17 +0000 (11:50 +0200)
commit74fadcf4ebe860c15d12cb4e065c7ca0e0dc4497
tree6b8c7834cf1372344df5af9cbfcdeaf2a17eea98
parent37bc691e7d26ea4eb61a8a434ebd7a9ae76225ab
sitnl: fix failure reporting by keeping error negative

The err->errno value reported by netlink is already negative.

Prepending ierr->errno with '-' when forwarding it to
the caller results in a positive value and thus not
detected as error.

Fix error handling in sitnl by not negating the sign of
the value returned by sitnl_send() in case of generic error.

While at it, print the errno in decimal form along with
its string represenation.

Reported-by: Richard Bonhomme <tincanteksup@gmail.com>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200418011849.382-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19773.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/networking_sitnl.c