summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-03 17:18:35 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-03 17:18:35 +0000
commita1d5abe1d502f970a79317fe1811cb26827aeb98 (patch)
treeb634a039939ba6aabb91393d2d2deaca0b87020b /sys/netinet6/ip6_forward.c
parent0285b2528a887ede4d0d8e002d48e65c1ad4a315 (diff)
Add TDB reference counting to ipsp_spd_lookup(). If an output
pointer is passed to the function, it will return a refcounted TDB. The ref happens when ipsp_spd_inp() copies the pointer from ipo->ipo_tdb. The caller of ipsp_spd_lookup() has to unref after using it. tested by Hrvoje Popovski; OK mvs@ tobhe@
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index c838aeeed9f..4b933ec6852 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_forward.c,v 1.103 2021/12/01 12:51:09 bluhm Exp $ */
+/* $OpenBSD: ip6_forward.c,v 1.104 2021/12/03 17:18:34 bluhm Exp $ */
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
/*
@@ -397,4 +397,7 @@ freecopy:
out:
rtfree(rt);
if_put(ifp);
+#ifdef IPSEC
+ tdb_unref(tdb);
+#endif /* IPSEC */
}