n-acd: fix handling of N_ACD_E_DROPPED

N_ACD_E_DROPPED is an error code of n-acd, albeit internal. But such codes are returned
as postive values, unlike error codes from errno.h (which are negative).

Fix comparing for N_ACD_E_DROPPED, otherwise the error gets propagate to the caller
when we should handle it internally.
This commit is contained in:
Thomas Haller 2021-09-30 15:02:13 +02:00
parent e989cbbd99
commit 6837095aab
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -420,7 +420,7 @@ int n_acd_probe_handle_timeout(NAcdProbe *probe) {
r = n_acd_send(probe->acd, &probe->ip, NULL);
if (r) {
if (r != -N_ACD_E_DROPPED)
if (r != N_ACD_E_DROPPED)
return r;
/*
@ -475,7 +475,7 @@ int n_acd_probe_handle_timeout(NAcdProbe *probe) {
r = n_acd_send(probe->acd, &probe->ip, &probe->ip);
if (r) {
if (r != -N_ACD_E_DROPPED)
if (r != N_ACD_E_DROPPED)
return r;
/*
@ -595,7 +595,7 @@ int n_acd_probe_handle_packet(NAcdProbe *probe, struct ether_arp *packet, bool h
if (!rate_limited) {
r = n_acd_send(probe->acd, &probe->ip, &probe->ip);
if (r) {
if (r != -N_ACD_E_DROPPED)
if (r != N_ACD_E_DROPPED)
return r;
if (probe->defend == N_ACD_DEFEND_ONCE) {
@ -604,7 +604,7 @@ int n_acd_probe_handle_packet(NAcdProbe *probe, struct ether_arp *packet, bool h
}
}
if (r != -N_ACD_E_DROPPED)
if (r != N_ACD_E_DROPPED)
probe->last_defend = now;
}