summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tftpd
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2018-01-26 16:40:14 +0000
committernaddy <naddy@openbsd.org>2018-01-26 16:40:14 +0000
commit0c1f8293fd080c38eee115a508287b70d641d47e (patch)
tree16100a5e30dbfa3706a2c4535113cf60f7aa3e7c /usr.sbin/tftpd
parentAdd kernel support for the VFP FPU/SIMD unit. Based on a diff by drahn@. (diff)
downloadwireguard-openbsd-0c1f8293fd080c38eee115a508287b70d641d47e.tar.xz
wireguard-openbsd-0c1f8293fd080c38eee115a508287b70d641d47e.zip
Handle the transfer size option when faking up /etc/random.seed.
Without this, clients that queried the size would receive 0 as response. ok jca@
Diffstat (limited to 'usr.sbin/tftpd')
-rw-r--r--usr.sbin/tftpd/tftpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c
index 8536cf59048..b3c708b9e3e 100644
--- a/usr.sbin/tftpd/tftpd.c
+++ b/usr.sbin/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpd.c,v 1.40 2017/11/07 14:15:38 jca Exp $ */
+/* $OpenBSD: tftpd.c,v 1.41 2018/01/26 16:40:14 naddy Exp $ */
/*
* Copyright (c) 2012 David Gwynne <dlg@uq.edu.au>
@@ -973,6 +973,8 @@ validate_access(struct tftp_client *client, const char *requested)
buf = client->buf + sizeof(client->buf) - 512;
arc4random_buf(buf, 512);
+ if (options != NULL && options[OPT_TSIZE].o_request)
+ options[OPT_TSIZE].o_reply = 512;
client->file = fmemopen(buf, 512, "r");
if (client->file == NULL)
return (errno + 100);