tr181: Fix LocalOnlyMode logic for Get method

This commit is contained in:
Amin Ben Romdhane
2025-10-30 10:46:20 +00:00
committed by IOPSYS Dev
parent c685111f87
commit 85fa0fe16d
2 changed files with 7 additions and 4 deletions

View File

@@ -162,9 +162,9 @@
{
"name": "enabled",
"type": "boolean",
"required": "yes",
"default": "0",
"description": "Enable interface"
"required": "no",
"default": "1",
"description": "Enable management of interface as 1905 AL interface"
},
{
"name": "ifname",

View File

@@ -582,7 +582,10 @@ static int get_IEEE1905AL_InterfaceNumberOfEntries(char *refparam, struct dmctx
static int get_IEEE1905AL_LocalOnlyMode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
return dmuci_get_option_value_string("ieee1905", "@al-iface[0]", "enabled", value);
char *enable = dmuci_get_option_value_fallback_def("ieee1905", "@al-iface[0]", "enabled", "1");
*value = (DM_STRCMP(enable, "1") == 0) ? "0" : "1";
return 0;
}
static int set_IEEE1905AL_LocalOnlyMode(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)