diff --git a/pybootd/__init__.py b/pybootd/__init__.py index cd56a3b..6379705 100644 --- a/pybootd/__init__.py +++ b/pybootd/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2019 Emmanuel Blot +# Copyright (c) 2010-2020 Emmanuel Blot # Copyright (c) 2010-2011 Neotion # # This library is free software; you can redistribute it and/or @@ -17,7 +17,7 @@ import os -__version__ = '1.7.1' +__version__ = '1.7.2' def pybootd_path(path): diff --git a/pybootd/pxed.py b/pybootd/pxed.py index ab8430f..670c01e 100644 --- a/pybootd/pxed.py +++ b/pybootd/pxed.py @@ -294,7 +294,8 @@ class BootpServer: # padding if tag == 0: padding_count += 1 - if padding_count > 255: + tail = tail[1:] + if padding_count > 0xFF: raise ValueError('Padding overflow') continue padding_count = 0 diff --git a/pybootd/tests/simple.py b/pybootd/tests/simple.py index a6dc405..7e76d5b 100755 --- a/pybootd/tests/simple.py +++ b/pybootd/tests/simple.py @@ -27,10 +27,10 @@ from binascii import hexlify, unhexlify from io import StringIO from socket import (socket, timeout, AF_INET, SOCK_DGRAM, IPPROTO_UDP, SOL_SOCKET, SO_BROADCAST, SO_REUSEADDR) -from sys import modules, stdout +from sys import modules from textwrap import fill from time import sleep -from unittest import TestCase, TestSuite, SkipTest, makeSuite, main as ut_main +from unittest import TestCase, TestSuite, makeSuite, main as ut_main from pybootd.daemons import BootpDaemon from pybootd.util import EasyConfigParser, logger_factory @@ -122,12 +122,12 @@ default = pxelinux.0 self.sock.sendto(req, ('', 67)) try: resp = self.sock.recv(1024) - print('response:\n', - fill(hexlify(resp).decode(), - initial_indent=' ', - subsequent_indent=' ')) + # print('response:\n', + # fill(hexlify(resp).decode(), + # initial_indent=' ', + # subsequent_indent=' ')) except timeout: - print('Timeout') + self.assertFalse(True, 'No response from response') def suite(): suite_ = TestSuite()