kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.1k stars 271 forks source link

Test for and fix implicit usage of native sized structs #645

Closed AiyionPrime closed 2 years ago

AiyionPrime commented 2 years ago

The struct.calcsize^1 in line 63 defaults to machine’s native format ^2, as long as not differently specified.

The data one parses should not yield different results based on the parsing machines architecture; which is acknowledged in

https://github.com/kbandla/dpkt/blob/2d30526422d48f83d4f724221d9ae0dcd5ff57fe/dpkt/dpkt.py#L45-L46

for __hdr_fmt__ but is lacking for __bit_fields__.

resolves #644

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.0001%) to 99.818% when pulling 46b943a6bb5d8b504566e0f4b081825f9c209457 on vorausrobotik:fix-standard-size-hdr-comparison into 2d30526422d48f83d4f724221d9ae0dcd5ff57fe on kbandla:master.