summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-04-07 20:35:57 +0000
committerRoy Marples <roy@marples.name>2016-04-07 20:35:57 +0000
commitd306a8f2df27b629cac51cd6df648262046dcd20 (patch)
tree4260a01b6cd62f96c647a781b9cb1941c528f649 /dhcpcd.c
parent0480237e31fb49330bc5d547e1bb863bb94b94d9 (diff)
downloaddhcpcd-d306a8f2df27b629cac51cd6df648262046dcd20.tar.xz
Linux netlink nlmsg_pid is not process id - only the first socket opened
has that. So after opening the link socket, open a persistent route socket and record the nlmsg_pid the kernel creates which is guaranteed unique and won't clash with a process id which can then be ignored by testing it directly and not that it's some large number.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index ac5720a4..9486a9c3 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1974,17 +1974,7 @@ exit1:
eloop_event_delete(ctx.eloop, ctx.link_fd);
close(ctx.link_fd);
}
- if (ctx.pf_inet_fd != -1)
- close(ctx.pf_inet_fd);
-#if defined(INET6) && defined(BSD)
- if (ctx.pf_inet6_fd != -1)
- close(ctx.pf_inet6_fd);
-#endif
-#ifdef IFLR_ACTIVE
- if (ctx.pf_link_fd != -1)
- close(ctx.pf_link_fd);
-#endif
-
+ if_closesockets(&ctx);
free_options(ifo);
free_globals(&ctx);
ipv4_ctxfree(&ctx);