Skip to content

Commit

Permalink
libpfctl: fix a mismerge breaking label addition
Browse files Browse the repository at this point in the history
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.

The bit that is most intriguing is that pfctl_add_eth_rule() doesn't
even exist on stable/13 and that this wasn't caught by the existing
tests.
  • Loading branch information
fichtner committed Nov 10, 2023
1 parent 8a697b0 commit cc48f7c
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 cc48f7c

Please sign in to comment.