From e3e86343fc0b0798d7e9eeba87c922c0b842dfc4 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 1 Mar 2012 10:35:34 +0000 Subject: [PATCH] Fix DUID generation with HAVE_BROKEN_RTC. --- src/dhcp6.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/dhcp6.c b/src/dhcp6.c index 9f9e161..747e156 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -383,18 +383,16 @@ static int make_duid1(int index, unsigned int type, char *mac, size_t maclen, vo (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_len = maclen + 8; - -#ifdef HAVE_BROKEN_RTC - PUTSHORT(3, p); /* DUID_LL */ -#else PUTSHORT(1, p); /* DUID_LLT */ -#endif - PUTSHORT(type, p); /* address type */ - -#ifndef HAVE_BROKEN_RTC PUTLONG(*((time_t *)parm), p); /* time */ #endif