From 6c9bc0156a8d36d56735831cb81e786d628ed73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Sun, 1 Dec 2024 23:50:18 +0000 Subject: [PATCH] Report multiple hostnames in --dhcp-host. This is not supported, and doesn't behave as one might expect. --- src/option.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/option.c b/src/option.c index b21fcba..3cf3520 100644 --- a/src/option.c +++ b/src/option.c @@ -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) 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)) || !legal_hostname(new->hostname))