phaethon/kamene

ERROR: clone_with() got multiple values for keyword argument 'payload'

Closed this issue · 3 comments

from scapy.all import rdpcap, wrpcap, fuzz, RTP

packets = rdpcap("g711a.pcap")
for p in packets:
    p["UDP"].payload = RTP(p["Raw"].load)
    del p["RTP"].timestamp
wrpcap("fuzzed.pcap", [fuzz(pkt) for pkt in packets])

Error is:

ERROR: clone_with() got multiple values for keyword argument 'payload'

PR incoming with a fix.

Right, in fact I've changed my mind and I think the right fix is to change "payload" in RTP to something else ("payloadtype"?). Keeping a field called "payload" around is just asking for trouble - payload is treated as a special case throughout the code.

Let me know if you agree, and whether you think this has acceptable impact (i.e. this would change the interface).

Yes, I agree that renaming payload field would make sense. This changes interface, but in an easy to fix way, and not everyone uses RTP anyway. Please, send a corresponding PR.