mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
pfilctl: fix 'pfilctl hooks' when nothing is connected
The 'hooks' command actually worked accidentially until now. It used PFILIOC_LISTHEADS to determine current number of hooks. This worked when at least one head had a hook connected to it. (cherry picked from commit 1bfe195143ffb6832ac6702e281964541554fcb3)
This commit is contained in:
parent
bf4972a48d
commit
cc16c3c3cb
1 changed files with 2 additions and 2 deletions
|
|
@ -151,8 +151,8 @@ listhooks(int argc __unused, char *argv[] __unused)
|
|||
u_int nhooks, i;
|
||||
|
||||
plh.pio_nhooks = 0;
|
||||
if (ioctl(dev, PFILIOC_LISTHEADS, &plh) != 0)
|
||||
err(1, "ioctl(PFILIOC_LISTHEADS)");
|
||||
if (ioctl(dev, PFILIOC_LISTHOOKS, &plh) != 0)
|
||||
err(1, "ioctl(PFILIOC_LISTHOOKS)");
|
||||
retry:
|
||||
plh.pio_hooks = calloc(plh.pio_nhooks, sizeof(struct pfilioc_hook));
|
||||
if (plh.pio_hooks == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue