mirror of
https://github.com/openwrt/luci
synced 2025-01-07 03:27:12 +08:00
rpcd-mod-luci: strip colon from dnsmasq duid
Dnsmasq DHCPv6 use colons in the generated duid present in the lease file. Strip the colon as this is not supported by the OpenWrt config and follow the same way odhcpd use to display duid. Fixes: #4543 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
parent
f488d28653
commit
f71e9cbd42
@ -329,6 +329,15 @@ duid2ea(const char *duid)
|
||||
return &ea;
|
||||
}
|
||||
|
||||
static void strip_colon_duid(char *str) {
|
||||
char *pr = str, *pw = str;
|
||||
|
||||
while (*pr) {
|
||||
*pw = *pr++;
|
||||
pw += (*pw != ':');
|
||||
}
|
||||
*pw = '\0';
|
||||
}
|
||||
|
||||
static struct {
|
||||
time_t now;
|
||||
@ -592,6 +601,8 @@ lease_next(void)
|
||||
if (!e.hostname || !e.duid)
|
||||
continue;
|
||||
|
||||
strip_colon_duid(e.duid);
|
||||
|
||||
if (!strcmp(e.hostname, "*"))
|
||||
e.hostname = NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user