Skip to content

Commit

Permalink
libpfctl: fix label setting
Browse files Browse the repository at this point in the history
A mismerge caused the labels list to be added to the wrong nvlist,
breaking label configuration.

If you compare the change from from main and stable/13 you
can see that main uses "nvl" and stable/13 has "nlvr" for
nvlist_append_string_array() but the backport changes it to "nlv".

This code was supposed to apply to pfctl_add_eth_rule() but instead
applied to pfctl_add_rule() for otherwise interesting reasons.  Since
pfctl_add_eth_rule() uses "nvl" and pfctl_add_rule() uses "nvlr" but
also has "nvl" this compiled fine but still broke the label set.

Direct commit to stable/13.

PR:		275006
  • Loading branch information
fichtner authored and kprovost committed Nov 10, 2023
1 parent cddce52 commit 83dbbe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libpfctl/libpfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor,
labelcount = 0;
while (labelcount < PF_RULE_MAX_LABEL_COUNT &&
r->label[labelcount][0] != 0) {
nvlist_append_string_array(nvl, "labels",
nvlist_append_string_array(nvlr, "labels",
r->label[labelcount]);
labelcount++;
}
Expand Down

0 comments on commit 83dbbe8

Please sign in to comment.