summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2018-11-20 03:42:56 +0000
committertedu <tedu@openbsd.org>2018-11-20 03:42:56 +0000
commit652a0caeba70e22e949ed9d18dc85dd0c09c9edc (patch)
treed28291aa86f2580961aaae0d60f51d77cd97f742
parentFix typos in memprobe address check. Diff from Andrew Daugherity. (diff)
downloadwireguard-openbsd-652a0caeba70e22e949ed9d18dc85dd0c09c9edc.tar.xz
wireguard-openbsd-652a0caeba70e22e949ed9d18dc85dd0c09c9edc.zip
move a magic constant into a magic define
-rw-r--r--usr.sbin/rebound/rebound.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c
index 6ccc69c0ab8..311607ccd6f 100644
--- a/usr.sbin/rebound/rebound.c
+++ b/usr.sbin/rebound/rebound.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rebound.c,v 1.101 2018/10/26 06:03:03 deraadt Exp $ */
+/* $OpenBSD: rebound.c,v 1.102 2018/11/20 03:42:56 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -43,6 +43,12 @@
#define MINIMUM(a,b) (((a)<(b))?(a):(b))
+/*
+ * TTL for permanently cached records.
+ * They don't expire, but need something to put in the response.
+ */
+#define CACHETTL 10
+
uint16_t randomid(void);
union sockun {
@@ -203,7 +209,7 @@ freecacheent(struct dnscache *ent)
}
/*
- * names end with either a nul byte, or a two byte 0xc0 pointer
+ * names end with either a nul byte or a two byte 0xc0 pointer
*/
static size_t
dnamelen(const unsigned char *p, size_t len)
@@ -677,7 +683,7 @@ preloadcache(const char *name, uint16_t type, void *rdata, uint16_t rdatalen)
p += 2;
memcpy(p, &class, 2);
p += 2;
- ttl = htonl(10);
+ ttl = htonl(CACHETTL);
memcpy(p, &ttl, 4);
p += 4;
len = htons(rdatalen);