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