arp_min_close_fd() and arp_close_fd() can return void.

This commit is contained in:
Nicholas J. Kain 2014-04-05 23:40:18 -04:00
parent 1c30247c36
commit 6b1d422d6f
2 changed files with 4 additions and 6 deletions

View File

@ -178,15 +178,14 @@ static int arp_open_fd(struct client_state_t *cs)
return 0; 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) if (cs->arpFd == -1)
return 0; return;
epoll_del(cs->epollFd, cs->arpFd); epoll_del(cs->epollFd, cs->arpFd);
close(cs->arpFd); close(cs->arpFd);
cs->arpFd = -1; cs->arpFd = -1;
arpState = AS_NONE; arpState = AS_NONE;
return 1;
} }
static void arp_switch_state(struct client_state_t *cs, arp_state_t state) 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); arp_min_close_fd(cs);
for (int i = 0; i < AS_MAX; ++i) for (int i = 0; i < AS_MAX; ++i)
arp_wake_ts[i] = -1; arp_wake_ts[i] = -1;
return 1;
} }
static void arp_reopen_fd(struct client_state_t *cs) static void arp_reopen_fd(struct client_state_t *cs)

View File

@ -59,7 +59,7 @@ extern int arp_probe_max;
extern int arp_relentless_def; extern int arp_relentless_def;
void arp_reset_send_stats(void); 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_check(struct client_state_t *cs, struct dhcpmsg *packet);
int arp_gw_check(struct client_state_t *cs); int arp_gw_check(struct client_state_t *cs);
void arp_set_defense_mode(struct client_state_t *cs); void arp_set_defense_mode(struct client_state_t *cs);