mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
IP.Interface: Enable value should be determined based on the status of all interfaces
This commit is contained in:
parent
457550b0c1
commit
a50855795e
1 changed files with 18 additions and 3 deletions
|
|
@ -1143,9 +1143,24 @@ static int get_IP_InterfaceNumberOfEntries(char *refparam, struct dmctx *ctx, vo
|
|||
/*#Device.IP.Interface.{i}.Enable!UCI:network/interface,@i-1/disabled*/
|
||||
static int get_IPInterface_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
char *disabled;
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "disabled", &disabled);
|
||||
*value = (*disabled == '1') ? "0" : "1";
|
||||
struct uci_section *s = NULL;
|
||||
char *device = NULL;
|
||||
|
||||
*value = "0";
|
||||
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "device", &device);
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "device", device, s) {
|
||||
char *disabled = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(s, "disabled", &disabled);
|
||||
|
||||
if (DM_STRCMP(disabled, "1") != 0) {
|
||||
*value = "1";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue