diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-10-27 08:20:00 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2005-10-27 08:20:00 +0000 |
commit | dd9d08590ceb16e8bbf38b75eb12d6a2742869a3 (patch) | |
tree | 3edc41d36f177cad26f89fb7f1a2610b672f69b1 /sbin/isakmpd | |
parent | 24ffc2e92b8832591d653c07a217d2e1c3c8d062 (diff) |
Do not touch LIST_* macro internals.
with otto@, ok ho@
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/transport.c | 3 | ||||
-rw-r--r-- | sbin/isakmpd/transport.h | 4 | ||||
-rw-r--r-- | sbin/isakmpd/udp.c | 9 | ||||
-rw-r--r-- | sbin/isakmpd/virtual.c | 13 |
4 files changed, 19 insertions, 10 deletions
diff --git a/sbin/isakmpd/transport.c b/sbin/isakmpd/transport.c index 8fce5a73c7e..2201e3169ee 100644 --- a/sbin/isakmpd/transport.c +++ b/sbin/isakmpd/transport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: transport.c,v 1.33 2005/04/08 23:15:26 hshoexer Exp $ */ +/* $OpenBSD: transport.c,v 1.34 2005/10/27 08:19:59 hshoexer Exp $ */ /* $EOM: transport.c,v 1.43 2000/10/10 12:36:39 provos Exp $ */ /* @@ -47,7 +47,6 @@ /* If no retransmit limit is given, use this as a default. */ #define RETRANSMIT_DEFAULT 10 -LIST_HEAD(transport_list, transport) transport_list; LIST_HEAD(transport_method_list, transport_vtbl) transport_method_list; /* Call the reinit function of the various transports. */ diff --git a/sbin/isakmpd/transport.h b/sbin/isakmpd/transport.h index 0a68c73fd24..a957cb6a125 100644 --- a/sbin/isakmpd/transport.h +++ b/sbin/isakmpd/transport.h @@ -1,4 +1,4 @@ -/* $OpenBSD: transport.h,v 1.15 2004/06/20 15:24:05 ho Exp $ */ +/* $OpenBSD: transport.h,v 1.16 2005/10/27 08:19:59 hshoexer Exp $ */ /* $EOM: transport.h,v 1.16 2000/07/17 18:57:59 provos Exp $ */ /* @@ -47,6 +47,8 @@ struct transport; +LIST_HEAD(transport_list, transport) transport_list; + /* This describes a tranport "method" like UDP or similar. */ struct transport_vtbl { /* All transport methods are linked together. */ diff --git a/sbin/isakmpd/udp.c b/sbin/isakmpd/udp.c index 9fa07c8aa16..7a9bbce5db2 100644 --- a/sbin/isakmpd/udp.c +++ b/sbin/isakmpd/udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp.c,v 1.91 2005/08/25 09:57:58 markus Exp $ */ +/* $OpenBSD: udp.c,v 1.92 2005/10/27 08:19:59 hshoexer Exp $ */ /* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */ /* @@ -357,6 +357,7 @@ void udp_remove(struct transport *t) { struct udp_transport *u = (struct udp_transport *)t; + struct transport *p; if (u->src) free(u->src); @@ -364,7 +365,11 @@ udp_remove(struct transport *t) free(u->dst); if ((t->flags & TRANSPORT_LISTEN) && u->s >= 0) close(u->s); - if (t->link.le_prev) + + for (p = LIST_FIRST(&transport_list); p && p != t; p = + LIST_NEXT(p, link)) + ; + if (p == t) LIST_REMOVE(t, link); LOG_DBG((LOG_TRANSPORT, 90, "udp_remove: removed transport %p", t)); diff --git a/sbin/isakmpd/virtual.c b/sbin/isakmpd/virtual.c index 4a7aa83beaf..55ce208b985 100644 --- a/sbin/isakmpd/virtual.c +++ b/sbin/isakmpd/virtual.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtual.c,v 1.23 2005/10/25 13:35:47 hshoexer Exp $ */ +/* $OpenBSD: virtual.c,v 1.24 2005/10/27 08:19:59 hshoexer Exp $ */ /* * Copyright (c) 2004 Håkan Olsson. All rights reserved. @@ -496,8 +496,7 @@ virtual_clone(struct transport *vt, struct sockaddr *raddr) memcpy(v2, v, sizeof *v); /* Remove the copy's links into virtual_listen_list. */ - v2->link.le_next = 0; - v2->link.le_prev = 0; + memset(&v2->link, 0, sizeof v2->link); if (v->encap_is_active) v2->main = 0; /* No need to clone this. */ @@ -571,13 +570,17 @@ virtual_create(char *name) static void virtual_remove(struct transport *t) { - struct virtual_transport *v = (struct virtual_transport *)t; + struct virtual_transport *p, *next, *v = (struct virtual_transport *)t; if (v->encap) v->encap->vtbl->remove(v->encap); if (v->main) v->main->vtbl->remove(v->main); - if (v->link.le_prev) + + for (p = LIST_FIRST(&virtual_listen_list); p && p != v; p = + LIST_NEXT(p, link)) + ; + if (p == v) LIST_REMOVE(v, link); LOG_DBG((LOG_TRANSPORT, 90, "virtual_remove: removed %p", v)); |