liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b438a0fd17e865ecbeefea7e3d9e53ec15853a1b
parent 2388e4ca24ffc04deee6c151d896ed7c64da7b36
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 15 Feb 2023 20:42:37 +0000

handlersocket must be bound before calling select()

this is due to a rather odd (imo) decision in luasocket which
says that the underlying socket (and therefore its file
descriptor) isn't actually created until we call something
that lets it work out whether ipv4 or ipv6

Diffstat:
Mpkgs/tufted/tftp.lua | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/pkgs/tufted/tftp.lua b/pkgs/tufted/tftp.lua @@ -301,6 +301,7 @@ function tftp:listen(rrq_generator_callback, wrq_generator_callback, hosts, port if request.opcode == 'WRQ' then requestsocket:sendto(self.ACK(0), host, port) end end local handlersocket = UDPSocket() + handlersocket:bind("*", 0) local handler = self['handle_' .. request.opcode](self, handlersocket, host, port, generator, request.options) return { handler=handler,