summaryrefslogtreecommitdiffstats
path: root/sbin/iked/policy.c
diff options
context:
space:
mode:
authortobhe <tobhe@openbsd.org>2020-03-09 11:50:43 +0000
committertobhe <tobhe@openbsd.org>2020-03-09 11:50:43 +0000
commit8177f5d56a19296cacc9cf967627dc5434ccd78b (patch)
tree9431dca012988c7d1dcea912dc42fcd762457e7a /sbin/iked/policy.c
parentcstyle in illumos noticed some weird syntax, which this fixes. (diff)
downloadwireguard-openbsd-8177f5d56a19296cacc9cf967627dc5434ccd78b.tar.xz
wireguard-openbsd-8177f5d56a19296cacc9cf967627dc5434ccd78b.zip
Use TAILQ_FOREACH_SAFE instead of hand rolled loops.
From Wataru <wataash at wataash dot com> ok patrick@
Diffstat (limited to 'sbin/iked/policy.c')
-rw-r--r--sbin/iked/policy.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sbin/iked/policy.c b/sbin/iked/policy.c
index 96070e50566..6c9baa9b619 100644
--- a/sbin/iked/policy.c
+++ b/sbin/iked/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.55 2020/03/01 19:17:58 tobhe Exp $ */
+/* $OpenBSD: policy.c,v 1.56 2020/03/09 11:50:43 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -512,11 +512,9 @@ sa_free(struct iked *env, struct iked_sa *sa)
void
sa_free_flows(struct iked *env, struct iked_saflows *head)
{
- struct iked_flow *flow, *next;
-
- for (flow = TAILQ_FIRST(head); flow != NULL; flow = next) {
- next = TAILQ_NEXT(flow, flow_entry);
+ struct iked_flow *flow, *flowtmp;
+ TAILQ_FOREACH_SAFE(flow, head, flow_entry, flowtmp) {
log_debug("%s: free %p", __func__, flow);
if (flow->flow_loaded)