Prevent tables referenced by rules in anchors from getting disabled.
authormikeb <mikeb@openbsd.org>
Tue, 20 Jan 2015 17:25:35 +0000 (17:25 +0000)
committermikeb <mikeb@openbsd.org>
Tue, 20 Jan 2015 17:25:35 +0000 (17:25 +0000)
Analysis and patch by Richard Kojedzinszky, thanks!  ok henning

sys/net/pf_table.c

index 9ee2578..4e43c4c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf_table.c,v 1.104 2014/12/19 17:14:40 tedu Exp $     */
+/*     $OpenBSD: pf_table.c,v 1.105 2015/01/20 17:25:35 mikeb Exp $    */
 
 /*
  * Copyright (c) 2002 Cedric Berger
@@ -1896,6 +1896,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf)
        struct pfr_kentryworkq  addrq;
 
        if (!(newf & PFR_TFLAG_REFERENCED) &&
+           !(newf & PFR_TFLAG_REFDANCHOR) &&
            !(newf & PFR_TFLAG_PERSIST))
                newf &= ~PFR_TFLAG_ACTIVE;
        if (!(newf & PFR_TFLAG_ACTIVE))