diff options
author | Franco Fichtner <franco@opnsense.org> | 2023-11-10 11:42:17 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2023-11-10 11:47:44 +0000 |
commit | 83dbbe8295ff0bb06a8f6b621c25d8224b026b77 (patch) | |
tree | 00d14a5f329f60a557fc0715e4d28823062faa7c | |
parent | cddce522f185c3a69977917b35efcf7bf96374bb (diff) | |
download | src-83dbbe8295ff0bb06a8f6b621c25d8224b026b77.tar.gz src-83dbbe8295ff0bb06a8f6b621c25d8224b026b77.zip |
libpfctl: fix label setting
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
-rw-r--r-- | lib/libpfctl/libpfctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index bf25a45b792f..4dec539e250b 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -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++; } |