while (l) {
n = l->next;
if (l == arg) {
- close(l->fd);
eloop_event_delete(ctx->eloop, l->fd);
+ close(l->fd);
if (last == NULL)
ctx->control_fds = l->next;
else
if (ctx->dev) {
if (stop)
syslog(LOG_DEBUG, "dev: unloaded %s", ctx->dev->name);
- ctx->dev->stop();
eloop_event_delete(ctx->eloop, ctx->dev_fd);
+ ctx->dev->stop();
free(ctx->dev);
ctx->dev = NULL;
ctx->dev_fd = -1;
}
if (ifp == NULL) {
if (ctx->udp_fd != -1) {
- close(ctx->udp_fd);
eloop_event_delete(ctx->eloop, ctx->udp_fd);
+ close(ctx->udp_fd);
ctx->udp_fd = -1;
}
}
if (ifp == NULL) {
if (ctx->ipv6->dhcp_fd != -1) {
- close(ctx->ipv6->dhcp_fd);
eloop_event_delete(ctx->eloop, ctx->ipv6->dhcp_fd);
+ close(ctx->ipv6->dhcp_fd);
ctx->ipv6->dhcp_fd = -1;
}
}
free(ctx.ifaces);
}
free(ctx.duid);
- if (ctx.link_fd != -1)
+ if (ctx.link_fd != -1) {
+ eloop_event_delete(ctx.eloop, ctx.link_fd);
close(ctx.link_fd);
+ }
free_options(ifo);
free_globals(&ctx);
eexit:
if (ctx->nd_fd != -1) {
- close(ctx->nd_fd);
eloop_event_delete(dctx->eloop, ctx->nd_fd);
+ close(ctx->nd_fd);
ctx->nd_fd = -1;
}
#ifdef IPV6_SEND_DAD
}
if (ifp == NULL) {
if (ctx->ipv6->nd_fd != -1) {
- close(ctx->ipv6->nd_fd);
eloop_event_delete(ctx->eloop, ctx->ipv6->nd_fd);
+ close(ctx->ipv6->nd_fd);
ctx->ipv6->nd_fd = -1;
}
}