goto exit_failure;
}
+ /* Open our persistent sockets.
+ * This is needed early for dumping leases on valid interfaces. */
+ if (if_opensockets(&ctx) == -1) {
+ logger(&ctx, LOG_ERR, "if_opensockets: %m");
+ goto exit_failure;
+ }
+
if (ctx.options & DHCPCD_DUMPLEASE) {
if (optind != argc - 1) {
logger(&ctx, LOG_ERR,
if (ctx.ifc == 1 && !(ctx.options & DHCPCD_BACKGROUND))
ctx.options |= DHCPCD_WAITIP;
- /* Open our persistent sockets. */
- if (if_opensockets(&ctx) == -1) {
- logger(&ctx, LOG_ERR, "if_opensockets: %m");
- goto exit_failure;
- }
+ /* Start handling kernel messages for interfaces, addreses and
+ * routes. */
eloop_event_add(ctx.eloop, ctx.link_fd, handle_link, &ctx, NULL, NULL);
/* Start any dev listening plugin which may want to