mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-27 20:14:15 +08:00
Ensure we remove the socket from the eloop event queue before closing it.
This commit is contained in:
parent
60dad20dbd
commit
e9882fb08a
@ -58,8 +58,8 @@ control_remove(void *arg)
|
||||
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
|
||||
|
2
dev.c
2
dev.c
@ -62,8 +62,8 @@ dev_stop(struct dhcpcd_ctx *ctx, int stop)
|
||||
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;
|
||||
|
2
dhcp.c
2
dhcp.c
@ -2739,8 +2739,8 @@ dhcp_free(struct interface *ifp)
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
2
dhcp6.c
2
dhcp6.c
@ -2672,8 +2672,8 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
4
dhcpcd.c
4
dhcpcd.c
@ -1480,8 +1480,10 @@ exit1:
|
||||
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);
|
||||
|
4
ipv6nd.c
4
ipv6nd.c
@ -235,8 +235,8 @@ unspec:
|
||||
|
||||
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
|
||||
@ -418,8 +418,8 @@ ipv6nd_free(struct interface *ifp)
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user