summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-07-26 09:26:37 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-07-26 09:26:37 +0000
commit2aa992f431510f43f6d4aa49c7650a9ec36f9961 (patch)
treeb00a349f051d8fcc89ea9cc5ace5d8a9c7a87b3d /usr.sbin
parent1e8613138440584fba694595981337d3bd98e652 (diff)
Implement possibility to send vendor class identifier (option 60) and
client identifier (option 61). Some dhcp servers expect these options and refuse to hand out a lease without them. Need for vendor class identifier pointed out & tested by bket Need for client identifier pointed out by sthen Input & reads OK sthen (as part of a larger diff) OK kn (as part of a larger diff)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcpleasectl/dhcpleasectl.c7
-rw-r--r--usr.sbin/dhcpleasectl/parser.c3
-rw-r--r--usr.sbin/dhcpleasectl/parser.h5
3 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/dhcpleasectl/dhcpleasectl.c b/usr.sbin/dhcpleasectl/dhcpleasectl.c
index 6e397191791..0edabf1ba9e 100644
--- a/usr.sbin/dhcpleasectl/dhcpleasectl.c
+++ b/usr.sbin/dhcpleasectl/dhcpleasectl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpleasectl.c,v 1.4 2021/06/16 14:06:18 florian Exp $ */
+/* $OpenBSD: dhcpleasectl.c,v 1.5 2021/07/26 09:26:36 florian Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
@@ -115,6 +115,11 @@ main(int argc, char *argv[])
/* Process user request. */
switch (res->action) {
+ case RELOAD:
+ imsg_compose(ibuf, IMSG_CTL_RELOAD, 0, 0, -1, NULL, 0);
+ printf("reload request sent.\n");
+ done = 1;
+ break;
case LOG_VERBOSE:
verbose = 1;
/* FALLTHROUGH */
diff --git a/usr.sbin/dhcpleasectl/parser.c b/usr.sbin/dhcpleasectl/parser.c
index eb9a0d88505..c77621eb3ec 100644
--- a/usr.sbin/dhcpleasectl/parser.c
+++ b/usr.sbin/dhcpleasectl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.1 2021/02/26 16:16:37 florian Exp $ */
+/* $OpenBSD: parser.c,v 1.2 2021/07/26 09:26:36 florian Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -61,6 +61,7 @@ static const struct token t_send[];
static const struct token t_send_request[];
static const struct token t_main[] = {
+ {KEYWORD, "reload", RELOAD, NULL},
{KEYWORD, "show", SHOW, t_show},
{KEYWORD, "log", NONE, t_log},
{KEYWORD, "send", NONE, t_send},
diff --git a/usr.sbin/dhcpleasectl/parser.h b/usr.sbin/dhcpleasectl/parser.h
index dad595b313e..4c4a89cd4cf 100644
--- a/usr.sbin/dhcpleasectl/parser.h
+++ b/usr.sbin/dhcpleasectl/parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.h,v 1.1 2021/02/26 16:16:37 florian Exp $ */
+/* $OpenBSD: parser.h,v 1.2 2021/07/26 09:26:36 florian Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -23,7 +23,8 @@ enum actions {
LOG_BRIEF,
SHOW,
SHOW_INTERFACE,
- SEND_REQUEST
+ SEND_REQUEST,
+ RELOAD
};
struct parse_result {