File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class DHCPPacket(object):
65
65
magic_cookie : ClassVar [bytes ] = b"\x63 \x82 \x53 \x63 "
66
66
cookie_offset_start : ClassVar [int ] = 236
67
67
cookie_offset_end : ClassVar [int ] = 240
68
- packet_fmt : ClassVar [str ] = "> BBBBLHHLLLL16s64s128s"
68
+ packet_fmt : ClassVar [str ] = "! BBBBLHHLLLL16s64s128s"
69
69
op_map : ClassVar [Dict [int , str ]] = {1 : "BOOTREQUEST" , 2 : "BOOTREPLY" }
70
70
inverse_op_map : ClassVar [Dict [str , int ]] = {v : k for k , v in op_map .items ()}
71
71
htype_map : ClassVar [Dict [int , str ]] = {
@@ -125,7 +125,7 @@ def from_bytes(cls, packet: bytes):
125
125
raise MalformedPacketError ("Magic cookie missing" )
126
126
try :
127
127
decoded_packet = [
128
- field .strip (b"\x00 " ) if isinstance (field , bytes ) else field
128
+ field .rstrip (b"\x00 " ) if isinstance (field , bytes ) else field
129
129
for field in struct .unpack (
130
130
cls .packet_fmt , packet [: cls .cookie_offset_start ]
131
131
)
You can’t perform that action at this time.
0 commit comments