On Fri, Nov 24, 2017 at 11:36:28AM +0100, Alexandr Nedvedicky wrote:
> this is yet another occurrence of infamous 'name vs. path mix up' [1].
> Leonardo Guardati hit this bug in rule optimizer this time. The patch
> below is part of 'the big diff' I've sent while ago [2].
>
> OK?
OK bluhm@
> --------8<---------------8<---------------8<------------------8<--------
> # diff fixes pf_opt_create_table() function
> diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c
> index a1b19781756..9f3751f480b 100644
> --- a/sbin/pfctl/pfctl_optimize.c
> +++ b/sbin/pfctl/pfctl_optimize.c
> @@ -1307,7 +1307,7 @@ again:
> tablenum++;
>
> if (pfctl_define_table(tbl->pt_name, PFR_TFLAG_CONST | tbl->pt_flags, 1,
> - pf->astack[0]->name, tbl->pt_buf, pf->astack[0]->ruleset.tticket)) {
> + pf->astack[0]->path, tbl->pt_buf, pf->astack[0]->ruleset.tticket)) {
> warn("failed to create table %s in %s",
> tbl->pt_name, pf->astack[0]->name);
> return (1);