duid = xmalloc(DUID_LEN);
if ((len = get_duid(duid, iface)) == 0)
syslog(LOG_ERR, "get_duid: %m");
- }
+ } else
+ duid = NULL;
if (len > 0) {
iface->clientid = xmalloc(len + 6);
iface->clientid[0] = len + 5;
memcpy(iface->clientid + 2, iface->hwaddr,
iface->hwlen);
}
+ free(duid);
}
if (ifo->options & DHCPCD_CLIENTID)
syslog(LOG_DEBUG, "%s: using ClientID %s", iface->name,
syslog(LOG_INFO, "version " VERSION " starting");
+#ifdef DEBUG_MEMORY
+ eloop_init();
+#endif
+
if ((signal_fd = signal_init()) == -1)
exit(EXIT_FAILURE);
if (signal_setup() == -1)
}
free(fds);
}
+
+void
+eloop_init(void)
+{
+
+ atexit(cleanup);
+}
#endif
_noreturn void
struct timeout *t;
struct timeval tv;
-#ifdef DEBUG_MEMORY
- atexit(cleanup);
-#endif
-
for (;;) {
/* Run all timeouts first.
* When we have one that has not yet occured,
void *);
void delete_q_timeout(int, void (*)(void *), void *);
void delete_q_timeouts(int, void *, void (*)(void *), ...);
+void eloop_init(void);
void start_eloop(void);
#endif