For DHCPv6, the second entry of a lease is the IAID. The parsing code
expects a MAC instead of a IAID.
Reported-by: Hartmut Birr <e9hack@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
ea = ether_aton(p);
- if (!ea)
- continue;
-
p = strtok(NULL, " \t\n");
if (p && inet_pton(AF_INET6, p, &e.addr.in6))
else
continue;
+ if (!ea && e.af != AF_INET6)
+ continue;
+
e.hostname = strtok(NULL, " \t\n");
e.duid = strtok(NULL, " \t\n");
if (!strcmp(e.duid, "*"))
e.duid = NULL;
- e.mac = *ea;
+ if (!ea && e.duid)
+ ea = duid2ea(e.duid);
+
+ if (ea)
+ e.mac = *ea;
return &e;
}