diff --git a/ndhc/arp.c b/ndhc/arp.c index 386a04e..b0a610d 100644 --- a/ndhc/arp.c +++ b/ndhc/arp.c @@ -178,15 +178,14 @@ static int arp_open_fd(struct client_state_t *cs) return 0; } -static int arp_min_close_fd(struct client_state_t *cs) +static void arp_min_close_fd(struct client_state_t *cs) { if (cs->arpFd == -1) - return 0; + return; epoll_del(cs->epollFd, cs->arpFd); close(cs->arpFd); cs->arpFd = -1; arpState = AS_NONE; - return 1; } static void arp_switch_state(struct client_state_t *cs, arp_state_t state) @@ -209,12 +208,11 @@ static void arp_switch_state(struct client_state_t *cs, arp_state_t state) } } -int arp_close_fd(struct client_state_t *cs) +void arp_close_fd(struct client_state_t *cs) { arp_min_close_fd(cs); for (int i = 0; i < AS_MAX; ++i) arp_wake_ts[i] = -1; - return 1; } static void arp_reopen_fd(struct client_state_t *cs) diff --git a/ndhc/arp.h b/ndhc/arp.h index f221ef0..7ff5eb7 100644 --- a/ndhc/arp.h +++ b/ndhc/arp.h @@ -59,7 +59,7 @@ extern int arp_probe_max; extern int arp_relentless_def; void arp_reset_send_stats(void); -int arp_close_fd(struct client_state_t *cs); +void arp_close_fd(struct client_state_t *cs); int arp_check(struct client_state_t *cs, struct dhcpmsg *packet); int arp_gw_check(struct client_state_t *cs); void arp_set_defense_mode(struct client_state_t *cs);