From b68fd538691abc2bf79a7f4829ec8b7b04e751ba Mon Sep 17 00:00:00 2001 From: "imen.bhiri" Date: Fri, 13 May 2016 17:22:08 +0100 Subject: [PATCH] Fix bug --- dm/dmtree/tr098/landevice.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dm/dmtree/tr098/landevice.c b/dm/dmtree/tr098/landevice.c index 33a54dc..27c6fdc 100644 --- a/dm/dmtree/tr098/landevice.c +++ b/dm/dmtree/tr098/landevice.c @@ -763,7 +763,8 @@ int set_lan_dhcp_leasetime(char *refparam, struct dmctx *ctx, int action, char * return 0; case VALUESET: uci_foreach_option_eq("dhcp", "dhcp", "interface", lan_name, s) { - sprintf(buf, "%dm", (atoi(value) / 60)); + int val = atoi(value); + sprintf(buf, "%dm%ds", (val / 60), (val % 60)); dmuci_set_value_by_section(s, "leasetime", buf); break; } @@ -827,7 +828,7 @@ int set_lan_dhcp_domainname(char *refparam, struct dmctx *ctx, int action, char } end: sprintf(buf, "15,%s", value); - dmuci_add_list_value("dhcp", lan_name, "dhcp_option", buf); + dmuci_add_list_value_by_section(s, "dhcp_option", buf); return 0; }