libpfctl: fix error handling

In two cases we returned E2BIG where it should have been a boolean ('false').

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2025-11-03 14:55:44 +01:00
parent e878ba8eea
commit 9bb1c46b4c
+2 -2
View File
@@ -1491,7 +1491,7 @@ snl_attr_get_pf_rule_labels(struct snl_state *ss, struct nlattr *nla,
bool ret;
if (l->i >= PF_RULE_MAX_LABEL_COUNT)
return (E2BIG);
return (false);
ret = snl_attr_copy_string(ss, nla, (void *)PF_RULE_LABEL_SIZE,
l->labels[l->i]);
@@ -1561,7 +1561,7 @@ snl_attr_get_pf_timeout(struct snl_state *ss, struct nlattr *nla,
bool ret;
if (t->i >= PFTM_MAX)
return (E2BIG);
return (false);
ret = snl_attr_get_uint32(ss, nla, NULL, &t->timeouts[t->i]);
if (ret)