summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-06-23 03:57:48 +0000
committerangelos <angelos@openbsd.org>2001-06-23 03:57:48 +0000
commite703c488c94b9586e4a5cd94e9e4b5830eca1f79 (patch)
tree0180fbdd935d5bf25f4d99fdd1c2bdc4d5b6b09e /sys
parentUse DLIST for tags (diff)
downloadwireguard-openbsd-e703c488c94b9586e4a5cd94e9e4b5830eca1f79.tar.xz
wireguard-openbsd-e703c488c94b9586e4a5cd94e9e4b5830eca1f79.zip
Use DLIST for tags.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf2.c28
-rw-r--r--sys/netinet/ip_ipsp.c24
2 files changed, 26 insertions, 26 deletions
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c
index 9ee8315c98a..b644d255034 100644
--- a/sys/kern/uipc_mbuf2.c
+++ b/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf2.c,v 1.13 2001/05/27 00:38:25 angelos Exp $ */
+/* $OpenBSD: uipc_mbuf2.c,v 1.14 2001/06/23 03:57:48 angelos Exp $ */
/* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
@@ -300,7 +300,7 @@ m_tag_prepend(m, t)
struct mbuf *m;
struct m_tag *t;
{
- LIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link);
+ DLIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link);
}
/* Unlink a packet tag. */
@@ -309,7 +309,7 @@ m_tag_unlink(m, t)
struct mbuf *m;
struct m_tag *t;
{
- LIST_REMOVE(t, m_tag_link);
+ DLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag_link);
}
/* Unlink and free a packet tag. */
@@ -333,10 +333,10 @@ m_tag_delete_chain(m, t)
if (t != NULL)
p = t;
else
- p = LIST_FIRST(&m->m_pkthdr.tags);
+ p = DLIST_FIRST(&m->m_pkthdr.tags);
if (p == NULL)
return;
- while ((q = LIST_NEXT(p, m_tag_link)) != NULL)
+ while ((q = DLIST_NEXT(p, m_tag_link)) != NULL)
m_tag_delete(m, q);
m_tag_delete(m, p);
}
@@ -351,13 +351,13 @@ m_tag_find(m, type, t)
struct m_tag *p;
if (t == NULL)
- p = LIST_FIRST(&m->m_pkthdr.tags);
+ p = DLIST_FIRST(&m->m_pkthdr.tags);
else
- p = LIST_NEXT(t, m_tag_link);
+ p = DLIST_NEXT(t, m_tag_link);
while (p != NULL) {
if (p->m_tag_id == type)
return (p);
- p = LIST_NEXT(p, m_tag_link);
+ p = DLIST_NEXT(p, m_tag_link);
}
return (NULL);
}
@@ -390,16 +390,16 @@ m_tag_copy_chain(to, from)
struct m_tag *p, *t, *tprev = NULL;
m_tag_delete_chain(to, NULL);
- LIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) {
+ DLIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) {
t = m_tag_copy(p);
if (t == NULL) {
m_tag_delete_chain(to, NULL);
return (0);
}
if (tprev == NULL)
- LIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link);
+ DLIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link);
else {
- LIST_INSERT_AFTER(tprev, t, m_tag_link);
+ DLIST_INSERT_AFTER(tprev, t, m_tag_link);
tprev = t;
}
}
@@ -411,7 +411,7 @@ void
m_tag_init(m)
struct mbuf *m;
{
- LIST_INIT(&m->m_pkthdr.tags);
+ DLIST_INIT(&m->m_pkthdr.tags);
}
/* Get first tag in chain. */
@@ -419,7 +419,7 @@ struct m_tag *
m_tag_first(m)
struct mbuf *m;
{
- return (LIST_FIRST(&m->m_pkthdr.tags));
+ return (DLIST_FIRST(&m->m_pkthdr.tags));
}
/* Get next tag in chain. */
@@ -428,5 +428,5 @@ m_tag_next(m, t)
struct mbuf *m;
struct m_tag *t;
{
- return (LIST_NEXT(t, m_tag_link));
+ return (DLIST_NEXT(t, m_tag_link));
}
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index da8f7ea8657..5dceabf1ba8 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.130 2001/06/08 03:13:14 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.131 2001/06/23 04:01:57 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -1263,7 +1263,7 @@ struct m_tag *
ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
{
int ipv4sa = 0, s, esphlen = 0, trail = 0, i;
- LIST_HEAD(packet_tags, m_tag) tags;
+ DLIST_HEAD(packet_tags, m_tag) tags;
unsigned char lasteight[8];
struct tdb_ident *tdbi;
struct m_tag *mtag;
@@ -1281,7 +1281,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6)
return NULL;
- LIST_INIT(&tags);
+ DLIST_INIT(&tags);
while (1)
{
@@ -1325,7 +1325,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
mtag = m_tag_get(PACKET_TAG_IPSEC_IN_CRYPTO_DONE,
sizeof(struct tdb_ident), M_NOWAIT);
if (mtag == NULL)
- return tags.lh_first;
+ return tags.dh_first;
tdbi = (struct tdb_ident *) (mtag + 1);
bzero(tdbi, sizeof(struct tdb_ident));
@@ -1335,7 +1335,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
tdbi->dst.sin6.sin6_family = AF_INET6;
tdbi->dst.sin6.sin6_len = sizeof(struct sockaddr_in6);
tdbi->dst.sin6.sin6_addr = ip6_dst;
- LIST_INSERT_HEAD(&tags, mtag, m_tag_link);
+ DLIST_INSERT_HEAD(&tags, mtag, m_tag_link);
}
else
if (nxtp == IPPROTO_IPV6)
@@ -1379,7 +1379,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
if (tdb == NULL)
{
splx(s);
- return tags.lh_first;
+ return tags.dh_first;
}
/* How large is the ESP header ? We use this later */
@@ -1396,7 +1396,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
if (tdb->tdb_flags & TDBF_RANDOMPADDING)
{
splx(s);
- return tags.lh_first;
+ return tags.dh_first;
}
/* Update the length of trailing ESP authenticators */
@@ -1412,11 +1412,11 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
if (lasteight[6] != 0)
{
if (lasteight[6] != lasteight[5])
- return tags.lh_first;
+ return tags.dh_first;
for (i = 4; lasteight[i + 1] != 1 && i >= 0; i--)
if (lasteight[i + 1] != lasteight[i] + 1)
- return tags.lh_first;
+ return tags.dh_first;
}
}
/* Fall through */
@@ -1424,7 +1424,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
mtag = m_tag_get(PACKET_TAG_IPSEC_IN_CRYPTO_DONE,
sizeof(struct tdb_ident), M_NOWAIT);
if (mtag == NULL)
- return tags.lh_first;
+ return tags.dh_first;
tdbi = (struct tdb_ident *) (mtag + 1);
bzero(tdbi, sizeof(struct tdb_ident));
@@ -1458,7 +1458,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
}
#endif /* INET6 */
- LIST_INSERT_HEAD(&tags, mtag, m_tag_link);
+ DLIST_INSERT_HEAD(&tags, mtag, m_tag_link);
/* Update next protocol/header and header offset */
if (proto == IPPROTO_AH)
@@ -1478,7 +1478,7 @@ ipsp_parse_headers(struct mbuf *m, int off, u_int8_t proto)
break;
default:
- return tags.lh_first; /* done */
+ return tags.dh_first; /* done */
}
}
}