summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2000-12-24 04:18:04 +0000
committerangelos <angelos@openbsd.org>2000-12-24 04:18:04 +0000
commitce64134c76872c1d3aa7b67142ec612b9df227e1 (patch)
tree19d592f1818f2080478f98c8a56f00a8cbb6468b
parentVarious repairs, mostly to get rid of short lines. (diff)
downloadwireguard-openbsd-ce64134c76872c1d3aa7b67142ec612b9df227e1.tar.xz
wireguard-openbsd-ce64134c76872c1d3aa7b67142ec612b9df227e1.zip
Extra argument in the function to tdb_walk(), indicating last TDB.
-rw-r--r--sys/netinet/ip_ipsp.c9
-rw-r--r--sys/netinet/ip_ipsp.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index cf926af0fac..b2c2fd0caf1 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.103 2000/12/18 16:45:32 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.104 2000/12/24 04:18:05 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -421,7 +421,7 @@ tdb_hashstats(void)
* Caller is responsible for setting at least spltdb().
*/
int
-tdb_walk(int (*walker)(struct tdb *, void *), void *arg)
+tdb_walk(int (*walker)(struct tdb *, void *, int), void *arg)
{
int i, rval = 0;
struct tdb *tdbp, *next;
@@ -433,7 +433,10 @@ tdb_walk(int (*walker)(struct tdb *, void *), void *arg)
for (tdbp = tdbh[i]; rval == 0 && tdbp != NULL; tdbp = next)
{
next = tdbp->tdb_hnext;
- rval = walker(tdbp, (void *)arg);
+ if (i == tdb_hashmask && next == NULL)
+ rval = walker(tdbp, (void *)arg, 1);
+ else
+ rval = walker(tdbp, (void *)arg, 0);
}
return rval;
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index 48c15b275bd..ca65f9dcc46 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.74 2000/10/14 06:23:52 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.75 2000/12/24 04:18:04 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -480,7 +480,7 @@ extern void tdb_expiration(struct tdb *, int);
/* Flag values for the last argument of tdb_expiration(). */
#define TDBEXP_EARLY 1 /* The tdb is likely to end up early. */
#define TDBEXP_TIMEOUT 2 /* Maintain expiration timeout. */
-extern int tdb_walk(int (*)(struct tdb *, void *), void *);
+extern int tdb_walk(int (*)(struct tdb *, void *, int), void *);
extern void handle_expirations(void *);
/* XF_IP4 */