Report multiple hostnames in --dhcp-host.

This is not supported, and doesn't behave as one might expect.
This commit is contained in:
Reynir Björnsson
2024-12-01 23:50:18 +00:00
committed by Simon Kelley
parent da2cc84854
commit 6c9bc0156a

View File

@@ -4155,7 +4155,12 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
} }
else if (strcmp(arg, "ignore") == 0) else if (strcmp(arg, "ignore") == 0)
new->flags |= CONFIG_DISABLE; new->flags |= CONFIG_DISABLE;
else if (new->hostname)
{
dhcp_config_free(new);
ret_err(_("DHCP host has multiple names"));
}
else
{ {
if (!(new->hostname = canonicalise_opt(arg)) || if (!(new->hostname = canonicalise_opt(arg)) ||
!legal_hostname(new->hostname)) !legal_hostname(new->hostname))