79094835

Date: 2024-10-16 15:51:00
Score: 0.5
Natty:
Report link

Previous proposal is good, however i2m() does not always return bytes

As a consequence, this will work better

def get_field_bytes(pkt, name):
     fld, val = pkt.getfield_and_val(name)
     return fld.addfield(pkt, b"", val)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Julien REINAULD