1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

pfctl: handle errors from PFNL_CMD_GETSTATES

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2026-05-05 18:57:25 +02:00
parent a0e4c65f18
commit c24b1d9359
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1991,6 +1991,7 @@ pfctl_show_states(int dev, const char *iface, int opts)
{
struct pfctl_show_state_arg arg;
struct pfctl_state_filter filter = {};
int ret;
if (iface != NULL)
strlcpy(filter.ifname, iface, IFNAMSIZ);
@@ -1999,8 +2000,8 @@ pfctl_show_states(int dev, const char *iface, int opts)
arg.dotitle = opts & PF_OPT_SHOWALL;
arg.iface = iface;
if (pfctl_get_states_h(pfh, &filter, pfctl_show_state, &arg))
return (-1);
if ((ret = pfctl_get_states_h(pfh, &filter, pfctl_show_state, &arg)) != 0)
errc(1, ret, "pfctl_get_states");
return (0);
}