summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-07-09 11:30:20 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-07-09 11:30:20 +0000
commit40a461e0f725a98fa76b8d56888479c0be6cc2e8 (patch)
treed4b25b1a9bf92c253a30d3906bfb22783782406b /sys/net/pf.c
parentef8c7a2d384c3b6902b23a4ffe56874de3b75ae1 (diff)
Fix previous commit which made src-node have a reference for the kif.
Src-node should use the reference counter since it might live longer than its table entry, rule or the associated states. OK sashan
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index d40aacea574..26c3d420254 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1083 2019/07/02 09:04:53 yasuoka Exp $ */
+/* $OpenBSD: pf.c,v 1.1084 2019/07/09 11:30:19 yasuoka Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -589,6 +589,7 @@ pf_insert_src_node(struct pf_src_node **sn, struct pf_rule *rule,
(*sn)->kif = kif;
pf_status.scounters[SCNT_SRC_NODE_INSERT]++;
pf_status.src_nodes++;
+ pfi_kif_ref(kif, PFI_KIF_REF_SRCNODE);
} else {
if (rule->max_src_states &&
(*sn)->states >= rule->max_src_states) {
@@ -612,6 +613,7 @@ pf_remove_src_node(struct pf_src_node *sn)
RB_REMOVE(pf_src_tree, &tree_src_tracking, sn);
pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++;
pf_status.src_nodes--;
+ pfi_kif_unref(sn->kif, PFI_KIF_REF_SRCNODE);
pool_put(&pf_src_tree_pl, sn);
}