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>
}
ret = sitnl_send(&req.n, 0, 0, NULL, NULL);
- if ((ret < 0) && (errno == EEXIST))
+ if (ret == -EEXIST)
{
ret = 0;
}
}
ret = sitnl_send(&req.n, 0, 0, NULL, NULL);
- if ((ret < 0) && (errno == EEXIST))
+ if (ret == -EEXIST)
{
ret = 0;
}