From b438a0fd17e865ecbeefea7e3d9e53ec15853a1b Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 15 Feb 2023 20:42:37 +0000 Subject: [PATCH] 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 --- pkgs/tufted/tftp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tufted/tftp.lua b/pkgs/tufted/tftp.lua index b4787a0..e0412e5 100644 --- 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,