Fixing 1851544 - server not tolerant of unsupported options

Thanks to Landon Jurgens for the report.


git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@75 63283fd4-ec1e-0410-9879-cb7f675518da
This commit is contained in:
msoulier 2007-12-16 15:48:36 +00:00
parent 89a8382cf1
commit f8af287f32

View file

@ -322,18 +322,13 @@ class TftpServerHandler(TftpSession):
self.send_oack()
elif len(recvpkt.options.keys()) > 0:
logger.warning("Client %s requested unsupported options: %s"
% (self.key, recvpkt.options))
logger.warning("Responding with negotiation error")
self.senderror(self.sock,
TftpErrors.FailedNegotiation,
self.host,
self.port)
raise TftpException, "Failed option negotiation"
else:
logger.debug("Client %s requested no options."
if len(recvpkt.options.keys()) > 0:
logger.warning("Client %s requested unsupported options: %s"
% (self.key, recvpkt.options))
logger.debug("Ignoring options, responding with DAT")
else:
logger.debug("Client %s requested no options."
% self.key)
self.start_download()