mirror of
https://dev.iopsys.eu/network/netmngr.git
synced 2025-12-20 01:00:36 +08:00
Align code with dhcpmngr dmmap file
This commit is contained in:
16
src/ip.c
16
src/ip.c
@@ -777,18 +777,26 @@ static void delete_ip_intertace_instance(struct dmctx *ctx, void *data, char *in
|
||||
dmuci_get_value_by_section_string(int_ss, "proto", &proto);
|
||||
|
||||
if (DM_LSTRCMP(proto, "dhcp") == 0) {
|
||||
struct uci_section *dhcpv4_client_s = get_dup_section_in_dmmap_opt("dmmap_dhcp_client", "interface", "iface_name", section_name(int_ss));
|
||||
char sec_name[128] = {0};
|
||||
|
||||
snprintf(sec_name, sizeof(sec_name), "network.%s", section_name(int_ss));
|
||||
|
||||
struct uci_section *dhcpv4_client_s = get_dup_section_in_dmmap_opt("DHCPv4", "Client", "__section_name__", sec_name);
|
||||
|
||||
if (dhcpv4_client_s) {
|
||||
dmuci_set_value_by_section_bbfdm(dhcpv4_client_s, "iface_name", "");
|
||||
dmuci_set_value_by_section_bbfdm(dhcpv4_client_s, "__section_name__", "");
|
||||
}
|
||||
}
|
||||
|
||||
if (DM_LSTRCMP(proto, "dhcpv6") == 0) {
|
||||
struct uci_section *dhcpv6_client_s = get_dup_section_in_dmmap_opt("dmmap_dhcpv6", "interface", "iface_name", section_name(int_ss));
|
||||
char sec_name[128] = {0};
|
||||
|
||||
snprintf(sec_name, sizeof(sec_name), "network.%s", section_name(int_ss));
|
||||
|
||||
struct uci_section *dhcpv6_client_s = get_dup_section_in_dmmap_opt("DHCPv6", "Client", "__section_name__", sec_name);
|
||||
|
||||
if (dhcpv6_client_s) {
|
||||
dmuci_set_value_by_section_bbfdm(dhcpv6_client_s, "iface_name", "");
|
||||
dmuci_set_value_by_section_bbfdm(dhcpv6_client_s, "__section_name__", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user