mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix DUID generation with HAVE_BROKEN_RTC.
This commit is contained in:
14
src/dhcp6.c
14
src/dhcp6.c
@@ -383,18 +383,16 @@ static int make_duid1(int index, unsigned int type, char *mac, size_t maclen, vo
|
|||||||
|
|
||||||
(void)index;
|
(void)index;
|
||||||
|
|
||||||
|
#ifdef HAVE_BROKEN_RTC
|
||||||
|
daemon->duid = p = safe_malloc(maclen + 4);
|
||||||
|
daemon->duid_len = maclen + 4;
|
||||||
|
PUTSHORT(3, p); /* DUID_LL */
|
||||||
|
PUTSHORT(type, p); /* address type */
|
||||||
|
#else
|
||||||
daemon->duid = p = safe_malloc(maclen + 8);
|
daemon->duid = p = safe_malloc(maclen + 8);
|
||||||
daemon->duid_len = maclen + 8;
|
daemon->duid_len = maclen + 8;
|
||||||
|
|
||||||
#ifdef HAVE_BROKEN_RTC
|
|
||||||
PUTSHORT(3, p); /* DUID_LL */
|
|
||||||
#else
|
|
||||||
PUTSHORT(1, p); /* DUID_LLT */
|
PUTSHORT(1, p); /* DUID_LLT */
|
||||||
#endif
|
|
||||||
|
|
||||||
PUTSHORT(type, p); /* address type */
|
PUTSHORT(type, p); /* address type */
|
||||||
|
|
||||||
#ifndef HAVE_BROKEN_RTC
|
|
||||||
PUTLONG(*((time_t *)parm), p); /* time */
|
PUTLONG(*((time_t *)parm), p); /* time */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user