diff options
| author | Roy Marples <roy@marples.name> | 2016-04-07 20:35:57 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-04-07 20:35:57 +0000 |
| commit | d306a8f2df27b629cac51cd6df648262046dcd20 (patch) | |
| tree | 4260a01b6cd62f96c647a781b9cb1941c528f649 /dhcpcd.c | |
| parent | 0480237e31fb49330bc5d547e1bb863bb94b94d9 (diff) | |
| download | dhcpcd-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.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -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); |
