From ba4fbca8a81d765f81aefc74db7f73ec9ded3550 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 28 Jun 2017 19:18:17 +0200 Subject: udhcpc6: make -O OPT work Patch is based on work by tiggerswelt.net. Signed-off-by: Denys Vlasenko --- networking/udhcp/dhcpd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'networking/udhcp/dhcpd.c') diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 5eff026bc..3a5fc2db7 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -361,6 +361,10 @@ static int FAST_FUNC read_staticlease(const char *const_line, void *arg) return 1; } +static int FAST_FUNC read_optset(const char *line, void *arg) { + return udhcp_str2optset(line, arg, dhcp_optflags, dhcp_option_strings); +} + struct config_keyword { const char *keyword; int (*handler)(const char *line, void *var) FAST_FUNC; @@ -387,8 +391,8 @@ static const struct config_keyword keywords[] = { {"pidfile" , read_str , OFS(pidfile ), "/var/run/udhcpd.pid"}, {"siaddr" , udhcp_str2nip , OFS(siaddr_nip ), "0.0.0.0"}, /* keywords with no defaults must be last! */ - {"option" , udhcp_str2optset, OFS(options ), ""}, - {"opt" , udhcp_str2optset, OFS(options ), ""}, + {"option" , read_optset , OFS(options ), ""}, + {"opt" , read_optset , OFS(options ), ""}, {"notify_file" , read_str , OFS(notify_file ), NULL}, {"sname" , read_str , OFS(sname ), NULL}, {"boot_file" , read_str , OFS(boot_file ), NULL}, -- cgit v1.2.3