-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug with cache of payload in packetlistfield #4414
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4414 +/- ##
==========================================
+ Coverage 81.43% 81.46% +0.03%
==========================================
Files 353 353
Lines 84258 84265 +7
==========================================
+ Hits 68615 68648 +33
+ Misses 15643 15617 -26
|
This patch indeed fixes the non-regression that I have reported, but does not fix everything that has been broken by _raw_packet_cache_field_value Based on the comment in test/fields.uts, it seems that scapy is no more intended to be usable when one want to parse a packet, change some of its content, and then build it again. |
That's not the case. Feel free to report any other regression you might encounter. |
Here is another regression.
|
@LRGH I have been following your latest comments for a few days now, and your behavior is hostile and borderline harassing towards Scapy maintainers. This is not welcome. Please stop immediately. We maintain Scapy in our spare time, like many other open source contributors, and we don't deserve this. You now have the opportunity to provide fixes and contribute to the project. Please be kind and do so instead of complaining and producing useless frictions. |
Indeed, I should not have had this behaviour. Please excuse me. |
I will try to be more constructive. It seems that all of this started with commit 1e1388d where a non-robust caching mechanism was introduced to improve the efficiency of I have made an experiment, by patching One example is the test |
I have created #4437 detected by disabling |
Thanks @LRGH ! |
The new patch still breaks some of my code, but it is likely that the reason is that I made some invalid assumptions when extending the functionality of some scapy internals. I am investigating. |
If this is fine to you @guedou , feel free to merge it. |
It took me some time to extract from my code another issue.
The output I expect is 4, but I see 3 instead. Note that this is not only some theoretical mix of various scapy classes. It is based on my implementation of the TETRA ISI protocol, where there is an Ethernet frame that contains a SIP message that contains a ROSE payload (hence the ASN.1) that contains a TETRA PDU (for which I had to extend the implementation of ASN.1 to allow payloads of class Packet). And I want to be able to change some inner field and rebuild an Ethernet frame (or at least the SIP message). |
Another piece of code.
The output is I would expect either |
edit:
now also handles #4414 (comment)