aboutsummaryrefslogtreecommitdiffstats
path: root/wg-dynamic-client.c
diff options
context:
space:
mode:
authorThomas Gschwantner <tharre3@gmail.com>2019-10-08 23:59:41 +0200
committerThomas Gschwantner <tharre3@gmail.com>2019-12-11 06:22:17 +0100
commit5e6042686610df56b15e40f531c5e67b99601215 (patch)
tree5c55ba98f9af23ff80e4a6f24b8d0c066fd43b0c /wg-dynamic-client.c
parentradix-trie: allow full use of the v4 address space (diff)
downloadwg-dynamic-5e6042686610df56b15e40f531c5e67b99601215.tar.xz
wg-dynamic-5e6042686610df56b15e40f531c5e67b99601215.zip
Fix parsing issue with split messages
Previously this would trigger a BUG_ON() since the calculation of length & offset was wrong since we added the previous part of the buffer (req->buf) in parse_request(). This meant handle_request() couldn't know how much bytes where actually left in the buffer or their offset.
Diffstat (limited to '')
-rw-r--r--wg-dynamic-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wg-dynamic-client.c b/wg-dynamic-client.c
index e425a27..2edb413 100644
--- a/wg-dynamic-client.c
+++ b/wg-dynamic-client.c
@@ -68,7 +68,7 @@ static void check_signal()
static int request_ip(struct wg_dynamic_request_ip *rip)
{
unsigned char buf[RECV_BUFSIZE + MAX_LINESIZE];
- size_t msglen, remaining, off = 0;
+ size_t msglen, remaining = 0, off = 0;
struct sockaddr_in6 dstaddr = {
.sin6_family = AF_INET6,
.sin6_addr = well_known,