Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tftp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ def _startSession(self, datagram, addr, mode):
# information to interested backends without adding extra call
# arguments, or switching to using a request object, for example.
context = {}
interface = ''
if self.transport is not None:
# Add the local and remote addresses to the call context.
local = self.transport.getHost()
interface = local.host
context["local"] = local.host, local.port
context["remote"] = addr
try:
Expand All @@ -82,12 +84,12 @@ def _startSession(self, datagram, addr, mode):
fs_interface = NetasciiReceiverProxy(fs_interface)
session = RemoteOriginWriteSession(addr, fs_interface,
datagram.options, _clock=self._clock)
reactor.listenUDP(0, session)
reactor.listenUDP(0, session, interface=interface)
returnValue(session)
elif datagram.opcode == OP_RRQ:
if mode == 'netascii':
fs_interface = NetasciiSenderProxy(fs_interface)
session = RemoteOriginReadSession(addr, fs_interface,
datagram.options, _clock=self._clock)
reactor.listenUDP(0, session)
reactor.listenUDP(0, session, interface=interface)
returnValue(session)