From a2731835992ef59cd3111f700ea0fa66d2425f71 Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Wed, 1 Apr 2020 12:37:21 +0100 Subject: [PATCH] DHCPv4: fic the value of DHCPv4.Server.Pool.{i}.Enable parameter --- dmtree/tr181/dhcpv4.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dmtree/tr181/dhcpv4.c b/dmtree/tr181/dhcpv4.c index e4465f52..53cc990d 100644 --- a/dmtree/tr181/dhcpv4.c +++ b/dmtree/tr181/dhcpv4.c @@ -756,10 +756,7 @@ static int get_dhcp_enable(char *refparam, struct dmctx *ctx, void *data, char * uci_foreach_option_eq("dhcp", "dhcp", "interface", ((struct dhcp_args *)data)->interface, s) { dmuci_get_value_by_section_string(s, "ignore", value); - if ((*value)[0] == '\0') - *value = "1"; - else - *value = "0"; + *value = ((*value)[0] == '1') ? "0" : "1"; return 0; } *value = "0";