-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch 2 #35
base: master
Are you sure you want to change the base?
Patch 2 #35
Conversation
ptftplib/dhcpserver.py
Outdated
@@ -171,6 +171,9 @@ def __init__(self, pkt): | |||
|
|||
# Strip off the ethernet frame and check the IP packet type. It should | |||
# be UDP (0x11) | |||
# for python3 it's bytes, need to decode to str first | |||
if type(pkt) is bytes: | |||
pkt = pkt.decode(errors='ignore') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is that I think this should happen in DHCPServer.serve_forever()
(line 251):
import six
...
pkt = DhcpPacket(six.ensure_str(data))
self.handle_dhcp_request(pkt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about this:
zhouronghua#1 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Can you get this into this PR? Don't forget to add six
to the requirements.txt
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Can you get this into this PR? Don't forget to add
six
to therequirements.txt
file.
sorry, it doesn't work, the content of the data have changed, i prefer to drop this PR, and adapt ord only
add ord adapter for python2 and python3
another version to solve the difference betwwen python2 and python3
decode first when get the packet