summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2018-05-01 15:11:42 +0000
committeranton <anton@openbsd.org>2018-05-01 15:11:42 +0000
commit11289bd530d07ddac286d083f76b7d5237e1d1ee (patch)
treeef9c034083c0f9f5009ff60249b23965653c18cf
parentvmmci(4) depends on pvbus(4) being available, unbreak (diff)
downloadwireguard-openbsd-11289bd530d07ddac286d083f76b7d5237e1d1ee.tar.xz
wireguard-openbsd-11289bd530d07ddac286d083f76b7d5237e1d1ee.zip
The length field of a DNS packet must be network byte order encoded; ok tedu@
-rw-r--r--usr.sbin/rebound/rebound.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c
index 9bff742c3a3..1b7800ffe66 100644
--- a/usr.sbin/rebound/rebound.c
+++ b/usr.sbin/rebound/rebound.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rebound.c,v 1.96 2018/04/30 17:43:36 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.97 2018/05/01 15:11:42 anton Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -676,7 +676,8 @@ preloadcache(const char *name, uint16_t type, void *rdata, uint16_t rdatalen)
ttl = htonl(10);
memcpy(p, &ttl, 4);
p += 4;
- memcpy(p, &rdatalen, 2);
+ len = htons(rdatalen);
+ memcpy(p, &len, 2);
p += 2;
memcpy(p, rdata, rdatalen);