]> git.ipfire.org Git - thirdparty/openvpn.git/commit
sitnl: fix ignoring EEXIST when sending a netlink command
authorAntonio Quartulli <a@unstable.cc>
Sat, 18 Apr 2020 09:43:50 +0000 (11:43 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 19 Apr 2020 09:58:15 +0000 (11:58 +0200)
commitdb3d737ba3ef9d83c5ceffa2f653d0ee4a8abb54
tree003ad8a64e8305721bfe8e41e3f08667a062e0e6
parentb9ff398884aa4576f2d9f75f2e2b54cd9688d122
sitnl: fix ignoring EEXIST when sending a netlink command

The logic is to treat EEXIST as non-error because it means that the
address/soute we wanted to install already exists, therefore we can
move on and not fail.

However, this logic is currently based on checking errno == EEXIST.
This is wrong, because sitnl_send() does not set errno, but returns the
error directly as negative value.

Fix this issue by directly comparing the the return value with -EEXIST.

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