Segmentation fault in set DHCP Relay interface, add relay interfaces to ip interfaces

This commit is contained in:
Omar Kallel 2019-04-01 10:14:52 +01:00
parent 2b6b0f2cc3
commit aeda48024b
2 changed files with 3 additions and 1 deletions

View file

@ -2567,6 +2567,8 @@ int set_DHCPv4RelayForwarding_Interface(char *refparam, struct dmctx *ctx, void
adm_entry_get_linker_value(ctx, newvalue, &linker);
} else
adm_entry_get_linker_value(ctx, value, &linker);
if(linker == NULL)
return FAULT_9007;
uci_path_foreach_sections(icwmpd, "dmmap_dhcp_relay", "interface", s) {
dmuci_get_value_by_section_string(s, "section_name", &v);
if(strcmp(v, linker) == 0)

View file

@ -3219,7 +3219,7 @@ int browseIPIfaceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data,
}
dmuci_get_value_by_section_string(p->config_section, "proto", &proto);
dmuci_get_value_by_section_string(p->config_section, "ip_int_instance", &inst);
if (ipv4addr[0] == '\0' && ipv6addr[0] == '\0' && strcmp(proto, "dhcp") != 0 && strcmp(proto, "dhcpv6") != 0 && strcmp(inst, "") == 0 && strcmp(type, "bridge") != 0) {
if (ipv4addr[0] == '\0' && ipv6addr[0] == '\0' && strcmp(proto, "dhcp") != 0 && strcmp(proto, "dhcpv6") != 0 && strcmp(proto, "relay") != 0 && strcmp(inst, "") == 0 && strcmp(type, "bridge") != 0) {
continue;
}
init_ip_args(&curr_ip_args, p->config_section, ipv4addr, ipv6addr);