ARP code can just try and free the istate if no astates left
after finishing the read loop.
if (TAILQ_FIRST(&state->arp_states) == NULL) {
arp_close(ifp);
if (state->bpf_flags & BPF_READING)
- state->bpf_flags |= BPF_EOF | BPF_FREE;
+ state->bpf_flags |= BPF_EOF;
else {
free(state);
ifp->if_data[IF_DATA_ARP] = NULL;
}
} else {
- state->bpf_flags &= BPF_FREE;
if (bpf_arp(ifp, state->bpf_fd) == -1)
logerr(__func__);
}
}
if (state != NULL) {
state->bpf_flags &= ~BPF_READING;
- if (state->bpf_flags & BPF_FREE)
- arp_tryfree(ifp);
+ /* Try and free the state if nothing left to do. */
+ arp_tryfree(ifp);
}
}
#ifndef BPF_HEADER
#define BPF_HEADER
-#define BPF_EOF (1U << 0)
-#define BPF_PARTIALCSUM (1U << 1)
-#define BPF_READING (1U << 2)
-#define BPF_FREE (1U << 3)
+#define BPF_READING (1U << 0)
+#define BPF_EOF (1U << 1)
+#define BPF_PARTIALCSUM (1U << 2)
#include "dhcpcd.h"