-
-
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
Packet().overload_fields can be overwritten #52
Conversation
Before: >>> fragment(IP() / ("X" * 10), 8)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "scapy/layers/inet.py", line 766, in fragment
r.overload_fields = p[IP].payload.overload_fields.copy()
File "scapy/packet.py", line 217, in __setattr__
except AttributeError:
AttributeError: 'Raw' object attribute 'overload_fields' is read-only After: >>> fragment(IP() / ("X" * 10), 8)
[<IP flags=MF frag=0 |<Raw load='XXXXXXXX' |>>, <IP flags= frag=1 |<Raw load='XX' |>>] |
I think that it would be a good idea to addd this call to fragment to the unit tests. |
@guedou agreed! Plus that allowed me to notice that |
try: | ||
dct["_%s" % attr] = dct.pop(attr) | ||
if cls.__name__ == "ISAKMP_payload_SA": | ||
print dct["_%s" % attr] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that this is a debugging statement that was forgotten =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum. Thanks :)
Packet().overload_fields can be overwritten
This is needed by fragment(), which has been broken since PR #11.