Ticket refs #6834: External ports Start value changing to 0 after adding and saving the newly created port forwarding rule

This commit is contained in:
Amin Ben Ramdhane 2021-12-21 16:18:23 +01:00
parent a2c041f228
commit 257a631c5d

View file

@ -547,7 +547,7 @@ static int set_nat_port_mapping_external_port(char *refparam, struct dmctx *ctx,
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "src_dport", &src_dport);
src_dport = src_dport ? strchr(src_dport, ':') : NULL;
if (src_dport == NULL)
snprintf(buffer, sizeof(buffer), "%s", value);
snprintf(buffer, sizeof(buffer), "%s:0", value);
else
snprintf(buffer, sizeof(buffer), "%s%s", value, src_dport);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "src_dport", buffer);