summaryrefslogtreecommitdiffstats
path: root/src/mpq.h
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-27 00:13:27 +1000
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-27 00:13:27 +1000
commitd50127db61e7597e4a52d16e339606aa3aada5ab (patch)
tree571c8a2f7fe602347a4d192ff0b8c2bdeb5f5fd8 /src/mpq.h
parentFix lock bug (diff)
downloadwireguard-openbsd-d50127db61e7597e4a52d16e339606aa3aada5ab.tar.xz
wireguard-openbsd-d50127db61e7597e4a52d16e339606aa3aada5ab.zip
Add length argument to mpq_init
This will allow a queue dependent length, here we choose a large size for transport packets, and a smaller size for handshake packets. The values are not specifically chosen and could be refined in the future.
Diffstat (limited to 'src/mpq.h')
-rw-r--r--src/mpq.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mpq.h b/src/mpq.h
index 7b7549cfdb3..f32bf7571fb 100644
--- a/src/mpq.h
+++ b/src/mpq.h
@@ -33,7 +33,7 @@ struct mpq {
void (*mpq_serial_fn)(struct mbuf *);
};
-void mpq_init(struct mpq *, int, struct mbuf *(*)(struct mbuf *), void (*)(struct mbuf *));
+void mpq_init(struct mpq *, int, int, struct mbuf *(*)(struct mbuf *), void (*)(struct mbuf *));
void mpq_barrier(struct mpq *);
void mpq_destroy(struct mpq *);
int mpq_enqueue(struct mpq *, struct mbuf *);
@@ -105,12 +105,12 @@ _mpq_thread(struct mpq *mpq)
/* External functions */
void
-mpq_init(struct mpq *mpq, int ipl, struct mbuf *(*parallel)(struct mbuf *), void (*serial)(struct mbuf *))
+mpq_init(struct mpq *mpq, int ipl, int maxlen, struct mbuf *(*parallel)(struct mbuf *), void (*serial)(struct mbuf *))
{
assert(parallel != NULL);
mpq->mpq_sactive = 0;
- mpq->mpq_maxlen = MPQ_DEFAULTLEN;
+ mpq->mpq_maxlen = maxlen;
mtx_init(&mpq->mpq_mtx, ipl);
ml_init(&mpq->mpq_list);
mpq->mpq_cursor = NULL;