Closed ebertland closed 6 years ago
Seems to be a regression when _update_fields() was newly introduced. A quick fix would be to force checksum recalculation by changing the TCP header like "tcp.sum = tcp.sum"
Should be fixed now in current master branch
Response timeout, closing ticket.
In a custom layer5 protocol, I added a header "length" in the hdr tuple of tuples. It is fixed size (2 octets) and I used the FIELD_FLAG_AUTOUPDATE option. I wrote the code for _update_fields (for current HEAD of master) and for bin() (version 4.0) to calculate the length of the upper_layer body and store that in self.length. For both, the correct length is written to the header of my custom protocol.
The problem is that the TCP.sum is never recalculated to account for the updated length field. I traced the calls, and I see that TCP._update_fields() is only called once and it is before the call to my custom protocol's _update_fields() (or bin() in the case of version 4.0).
Can you recommend an example where a layer567 protocol is layered above TCP, and it has automatically updated simple header fields? I am not doing anything complicated that requires dynamic fields, deactivated fields, or trigger lists.