int			 setflag, clrflag;
int			 nflags;
pfr_commit_ktable(struct pfr_ktable *kt, long tzero){	struct pfr_ktable	*shadow = kt->pfrkt_shadow;	int			 setflag, clrflag;	if (shadow->pfrkt_cnt == NO_ADDRESSES) {		if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE))			pfr_clstats_ktable(kt, tzero, 1);	} else if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) {		/* kt might contain addresses */		struct pfr_kentryworkq	 addrq, addq, changeq, delq, garbageq;		struct pfr_kentry	*p, *q, *next;		struct pfr_addr		 ad;		pfr_enqueue_addrs(shadow, &addrq, NULL, 0);		pfr_mark_addrs(kt);		SLIST_INIT(&addq);		SLIST_INIT(&changeq);		SLIST_INIT(&delq);		SLIST_INIT(&garbageq);		for (p = SLIST_FIRST(&addrq); p != NULL; p = next) {			next = SLIST_NEXT(p, pfrke_workq);	/* XXX */			pfr_copyout_addr(&ad, p);			q = pfr_lookup_addr(kt, &ad, 1);			if (q != NULL) {				if (q->pfrke_not != p->pfrke_not)					SLIST_INSERT_HEAD(&changeq, q,					    pfrke_workq);				q->pfrke_mark = 1;				SLIST_INSERT_HEAD(&garbageq, p, pfrke_workq);			} else {				p->pfrke_tzero = tzero;				SLIST_INSERT_HEAD(&addq, p, pfrke_workq);			}		}		pfr_enqueue_addrs(kt, &delq, NULL, ENQUEUE_UNMARKED_ONLY);		pfr_insert_kentries(kt, &addq, tzero);		pfr_remove_kentries(kt, &delq);		pfr_clstats_kentries(&changeq, tzero, INVERT_NEG_FLAG);		pfr_destroy_kentries(&garbageq);	} else {		/* kt cannot contain addresses */		SWAP(struct radix_node_head *, kt->pfrkt_ip4,		    shadow->pfrkt_ip4);		SWAP(struct radix_node_head *, kt->pfrkt_ip6,		    shadow->pfrkt_ip6);		SWAP(int, kt->pfrkt_cnt, shadow->pfrkt_cnt);		pfr_clstats_ktable(kt, tzero, 1);	}	setflag = shadow->pfrkt_flags & PFR_TFLAG_USRMASK;	clrflag = (kt->pfrkt_flags & ~setflag) & PFR_TFLAG_USRMASK;	setflag |= PFR_TFLAG_ACTIVE;	clrflag |= PFR_TFLAG_INACTIVE;	pfr_destroy_ktable(shadow, 0);	kt->pfrkt_shadow = NULL;	pfr_setflags_ktable(kt, setflag, clrflag);}