Diameter.__bytes__
has side effects (messes up len
and cmd
)
#647
Labels
Diameter.__bytes__
has side effects (messes up len
and cmd
)
#647
Describe the bug
After parsing a Diameter message, calling
__bytes__
(e.g. by printing it)To Reproduce
Steps to reproduce the behavior:
Expected behavior
No fields should be affected by printing the object.
len
andcmd
should stay the same.Details(please complete the following information):
Sadly I cannot upload any pcap files (legal reasons), but the issue is very obvious.
Additional context
The cause of the problem is that
__bytes__
callspack_hdr
which changes the member variables. Ideally it would not touch them or at the very least restore them: https://github.com/kbandla/dpkt/blob/master/dpkt/diameter.py#L106The text was updated successfully, but these errors were encountered: