batman_sysctl: Fix small logic bug for BSD systems.

We should be counting the number of instances other than the
one we are deleting.
This commit is contained in:
Alastair Poole 2019-12-22 21:45:23 +00:00
parent 7227aaeb81
commit 72a962921c
1 changed files with 2 additions and 4 deletions

View File

@ -177,11 +177,9 @@ _batman_sysctl_stop(Instance *inst)
if (inst->cfg->esm == E_SYSINFO_MODULE_BATMAN ||
inst->cfg->esm == E_SYSINFO_MODULE_SYSINFO)
{
bat_num++;
if (child == inst)
if (child != inst)
{
bat_num--;
break;
bat_num++;
}
}
}