mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
DHCPv{4,6}: Show the correct IP.Interface. for Interface parameter
This commit is contained in:
parent
70459eb4ad
commit
413599c2fb
2 changed files with 29 additions and 0 deletions
|
|
@ -2165,6 +2165,20 @@ static int get_DHCPv4Client_Interface(char *refparam, struct dmctx *ctx, void *d
|
|||
dmuci_get_value_by_section_string(dhcpv4_client->dmmap_s, "iface_name", &iface_name);
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", iface_name, value);
|
||||
|
||||
if (DM_STRLEN(*value) == 0 && dhcpv4_client->iface_s) {
|
||||
struct uci_section *s = NULL;
|
||||
char *device = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(dhcpv4_client->iface_s, "device", &device);
|
||||
if (DM_STRLEN(device) == 0)
|
||||
return 0;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "device", device, s) {
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", section_name(s), value);
|
||||
if (DM_STRLEN(*value))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -528,6 +528,21 @@ static int get_DHCPv6Client_Interface(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
dmuci_get_value_by_section_string(dhcpv6_client->dmmap_s, "iface_name", &iface_name);
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", iface_name, value);
|
||||
|
||||
if (DM_STRLEN(*value) == 0 && dhcpv6_client->iface_s) {
|
||||
struct uci_section *s = NULL;
|
||||
char *device = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(dhcpv6_client->iface_s, "device", &device);
|
||||
if (DM_STRLEN(device) == 0)
|
||||
return 0;
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "device", device, s) {
|
||||
adm_entry_get_linker_param(ctx, "Device.IP.Interface.", section_name(s), value);
|
||||
if (DM_STRLEN(*value))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue