From: sashan Date: Thu, 5 Jan 2023 10:06:58 +0000 (+0000) Subject: pfctl fails to add addresses to undefined/inactive table X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=38f9a0c9d30813e3a61c60f891a7047cedb67566;p=openbsd 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 to any' |pfctl -f - # pfctl -t foo -T add 192.168.1.0/24 pfctl: Table does not exist OK mbuhl@ --- 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); } }