pf: rename PF_OPT_TABLE_PREFIX to PF_OPTIMIZER_TABLE_PFX

Move it to pf.h.
OPT is misleading and usually refers to command line arguments to pfctl

ok sashan kn

Obtained from:	OpenBSD, henning <henning@openbsd.org>, 9c6ad19ba4
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2025-07-07 11:39:07 +02:00
parent a4b7e54000
commit 9f21a946d0
3 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1248,7 +1248,7 @@ add_opt_table(struct pfctl *pf, struct pf_opt_tbl **tbl, sa_family_t af,
/* This is just a temporary table name */ /* This is just a temporary table name */
snprintf((*tbl)->pt_name, sizeof((*tbl)->pt_name), "%s%d", snprintf((*tbl)->pt_name, sizeof((*tbl)->pt_name), "%s%d",
PF_OPT_TABLE_PREFIX, tablenum++); PF_OPTIMIZER_TABLE_PFX, tablenum++);
DEBUG("creating table <%s>", (*tbl)->pt_name); DEBUG("creating table <%s>", (*tbl)->pt_name);
} }
@@ -1315,9 +1315,9 @@ pf_opt_create_table(struct pfctl *pf, struct pf_opt_tbl *tbl)
/* Now we have to pick a table name that isn't used */ /* Now we have to pick a table name that isn't used */
again: again:
DEBUG("translating temporary table <%s> to <%s%x_%d>", tbl->pt_name, DEBUG("translating temporary table <%s> to <%s%x_%d>", tbl->pt_name,
PF_OPT_TABLE_PREFIX, table_identifier, tablenum); PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum);
snprintf(tbl->pt_name, sizeof(tbl->pt_name), "%s%x_%d", snprintf(tbl->pt_name, sizeof(tbl->pt_name), "%s%x_%d",
PF_OPT_TABLE_PREFIX, table_identifier, tablenum); PF_OPTIMIZER_TABLE_PFX, table_identifier, tablenum);
PFRB_FOREACH(t, &table_buffer) { PFRB_FOREACH(t, &table_buffer) {
if (strcasecmp(t->pfrt_name, tbl->pt_name) == 0) { if (strcasecmp(t->pfrt_name, tbl->pt_name) == 0) {
/* Collision. Try again */ /* Collision. Try again */
-1
View File
@@ -263,7 +263,6 @@ struct pf_opt_tbl {
struct node_tinithead pt_nodes; struct node_tinithead pt_nodes;
struct pfr_buffer *pt_buf; struct pfr_buffer *pt_buf;
}; };
#define PF_OPT_TABLE_PREFIX "__automatic_"
/* optimizer pf_rule container */ /* optimizer pf_rule container */
struct pf_opt_rule { struct pf_opt_rule {
+1
View File
@@ -490,6 +490,7 @@ struct pf_osfp_ioctl {
#define PF_ANCHOR_NAME_SIZE 64 #define PF_ANCHOR_NAME_SIZE 64
#define PF_ANCHOR_MAXPATH (MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1) #define PF_ANCHOR_MAXPATH (MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1)
#define PF_OPTIMIZER_TABLE_PFX "__automatic_"
struct pf_rule { struct pf_rule {
struct pf_rule_addr src; struct pf_rule_addr src;