Be more picly about the MAC address we use for DUID-creation.

This commit is contained in:
Simon Kelley
2012-03-01 13:43:39 +00:00
parent e3e86343fc
commit 0f08983d85

View File

@@ -377,12 +377,16 @@ void make_duid(time_t now)
static int make_duid1(int index, unsigned int type, char *mac, size_t maclen, void *parm)
{
/* create DUID as specified in RFC3315. We use the MAC of the
first interface we find that isn't loopback or P-to-P */
first interface we find that isn't loopback or P-to-P and
has address-type < 256. Address types above 256 are things like
tunnels which don't have usable MAC addresses. */
unsigned char *p;
(void)index;
if (type >= 256)
return 1;
#ifdef HAVE_BROKEN_RTC
daemon->duid = p = safe_malloc(maclen + 4);
daemon->duid_len = maclen + 4;