mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
bugfix: count dynamic Rule instances during FIND_MAX
Root cause: handle_instance_without_section() returned empty in BROWSE_FIND_MAX_INST, so dynamic (UPnP) rules weren’t counted and new static rules reused indices. Fix: also allocate/return the instance in FIND_MAX so dynamic instances contribute to max_instance and indices remain consistent.
This commit is contained in:
parent
aa48055446
commit
2038670602
1 changed files with 8 additions and 8 deletions
|
|
@ -620,6 +620,7 @@ char *handle_instance(struct dmctx *dmctx, DMNODE *parent_node, struct uci_secti
|
|||
|
||||
switch(parent_node->browse_type) {
|
||||
case BROWSE_NORMAL:
|
||||
case BROWSE_FIND_MAX_INST:
|
||||
if (instance && *instance == '\0') {
|
||||
int max_inst = find_max_instance(dmctx, parent_node);
|
||||
snprintf(buf, sizeof(buf), "%d", max_inst);
|
||||
|
|
@ -627,7 +628,6 @@ char *handle_instance(struct dmctx *dmctx, DMNODE *parent_node, struct uci_secti
|
|||
instance = dmstrdup(buf);
|
||||
}
|
||||
break;
|
||||
case BROWSE_FIND_MAX_INST:
|
||||
case BROWSE_NUM_OF_ENTRIES:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue