Skip to content

Commit a600afc

Browse files
committed
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. Signed-off-by: Thomas Haller <[email protected]> #8
1 parent 5c43b8a commit a600afc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/n-acd-probe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ int n_acd_probe_handle_timeout(NAcdProbe *probe) {
420420

421421
r = n_acd_send(probe->acd, &probe->ip, NULL);
422422
if (r) {
423-
if (r != -N_ACD_E_DROPPED)
423+
if (r != N_ACD_E_DROPPED)
424424
return r;
425425

426426
/*
@@ -475,7 +475,7 @@ int n_acd_probe_handle_timeout(NAcdProbe *probe) {
475475

476476
r = n_acd_send(probe->acd, &probe->ip, &probe->ip);
477477
if (r) {
478-
if (r != -N_ACD_E_DROPPED)
478+
if (r != N_ACD_E_DROPPED)
479479
return r;
480480

481481
/*
@@ -595,7 +595,7 @@ int n_acd_probe_handle_packet(NAcdProbe *probe, struct ether_arp *packet, bool h
595595
if (!rate_limited) {
596596
r = n_acd_send(probe->acd, &probe->ip, &probe->ip);
597597
if (r) {
598-
if (r != -N_ACD_E_DROPPED)
598+
if (r != N_ACD_E_DROPPED)
599599
return r;
600600

601601
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
604604
}
605605
}
606606

607-
if (r != -N_ACD_E_DROPPED)
607+
if (r != N_ACD_E_DROPPED)
608608
probe->last_defend = now;
609609
}
610610

0 commit comments

Comments
 (0)