From 0f08983d85ff31302f61ae929f94651d2049e115 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 1 Mar 2012 13:43:39 +0000 Subject: [PATCH] Be more picly about the MAC address we use for DUID-creation. --- src/dhcp6.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dhcp6.c b/src/dhcp6.c index 747e156..e20ca36 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -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;