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>
}
else
{
- msg(M_WARN, "%s: rtnl: generic error: %s",
- __func__, strerror(-err->error));
- ret = -err->error;
+ msg(M_WARN, "%s: rtnl: generic error (%d): %s",
+ __func__, err->error, strerror(-err->error));
+ ret = err->error;
}
}
goto out;