File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed
Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -101,21 +101,6 @@ def __bytes__(self) -> bytes:
101101 _payload [2 :4 ] = inet_cksum (_payload ).to_bytes (2 )
102102 return bytes (_payload )
103103
104- # Automatically calculate checksum if IpProto is ICMPv4 or ICMPv6 packet and checksum is not set.
105- if self ._ip_proto == IpProto .UDP and self ._payload [6 :8 ] == b"\x00 \x00 " :
106- _payload = bytearray (self ._payload )
107- _payload [6 :8 ] = inet_cksum (_payload , self .pshdr_sum ).to_bytes (2 )
108- return bytes (_payload )
109-
110- # Automatically calculate checksum if IpProto is TCP packet and checksum is not set.
111- if (
112- self ._ip_proto == IpProto .TCP
113- and self ._payload [16 :18 ] == b"\x00 \x00 "
114- ):
115- _payload = bytearray (self ._payload )
116- _payload [16 :18 ] = inet_cksum (_payload , self .pshdr_sum ).to_bytes (2 )
117- return bytes (_payload )
118-
119104 return self ._payload
120105
121106 @property
You can’t perform that action at this time.
0 commit comments