Note we may wish to handle ACD for DHCP in the future.
}
}
-void
+static void
arp_close(struct interface *ifp)
{
struct iarp_state *state;
- if ((state = ARP_STATE(ifp)) != NULL && state->bpf_fd != -1) {
- eloop_event_delete(ifp->ctx->eloop, state->bpf_fd);
- bpf_close(ifp, state->bpf_fd);
- state->bpf_fd = -1;
- state->bpf_flags |= BPF_EOF;
- }
+ if ((state = ARP_STATE(ifp)) == NULL || state->bpf_fd == -1)
+ return;
+
+ eloop_event_delete(ifp->ctx->eloop, state->bpf_fd);
+ bpf_close(ifp, state->bpf_fd);
+ state->bpf_fd = -1;
+ state->bpf_flags |= BPF_EOF;
}
static void
int arp_open(struct interface *);
ssize_t arp_request(const struct interface *, in_addr_t, in_addr_t);
void arp_probe(struct arp_state *);
-void arp_close(struct interface *);
void arp_report_conflicted(const struct arp_state *, const struct arp_msg *);
struct arp_state *arp_new(struct interface *, const struct in_addr *);
struct arp_state *arp_find(struct interface *, const struct in_addr *);
return;
}
arp_free(astate);
-#ifdef KERNEL_RFC5227
- /* As arping is finished, close the ARP socket.
- * The kernel will handle ACD from here. */
- arp_close(ifp);
-#endif
dhcpcd_startinterface(ifp);
return;
}
return;
}
arp_free(astate);
-#ifdef KERNEL_RFC5227
- /* As arping is finished, close the ARP socket.
- * The kernel will handle ACD from here. */
- arp_close(ifp);
-#endif
eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
dhcpcd_startinterface(ifp);
return;
dhcp_arp_announced(struct arp_state *state)
{
- /* Free the ARP state as we currently don't care about ACD for DHCP. */
+// TODO: DHCP addresses handle ACD?
+//#ifdef KERNEL_RFC5227
arp_free(state);
+//#endif
}
#endif