diff options
author | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2023-01-05 10:06:59 +0000 |
---|---|---|
committer | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2023-01-05 10:06:59 +0000 |
commit | 8f76ff58113dc6fdfc4599e9586770f39f41c17e (patch) | |
tree | b37f2e4a06ff0a7fcad81a83bd587898fe3c5bc2 /sys/net/pf_table.c | |
parent | 40b390b973110f00cf3e8e5bc66b1f1b93f3d470 (diff) |
pfctl fails to add addresses to undefined/inactive table
pfr_add_tables() function must set PFR_TFLAG_ACTIVE flag
to table which is attached to rule. This will then allow
pfr_add_addrs() to populate the table with addresses.
without this pair of pfctl(8) commands fails as follows:
# echo 'pass from <foo> to any' |pfctl -f -
# pfctl -t foo -T add 192.168.1.0/24
pfctl: Table does not exist
OK mbuhl@
Diffstat (limited to 'sys/net/pf_table.c')
-rw-r--r-- | sys/net/pf_table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index f537aac2387..6f23a6f795d 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.143 2022/06/26 11:37:08 mbuhl Exp $ */ +/* $OpenBSD: pf_table.c,v 1.144 2023/01/05 10:06:58 sashan Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -1566,7 +1566,7 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags) } else if (!(flags & PFR_FLAG_DUMMY) && !(p->pfrkt_flags & PFR_TFLAG_ACTIVE)) { p->pfrkt_nflags = (p->pfrkt_flags & - ~PFR_TFLAG_USRMASK) | key.pfrkt_flags; + ~PFR_TFLAG_USRMASK) | PFR_TFLAG_ACTIVE; SLIST_INSERT_HEAD(&changeq, p, pfrkt_workq); } } |