Fix ICMPEcho_am description
From the ICMPEcho_am code:
def make_reply(self, req):
reply = IP(dst=req[IP].src) / ICMP()
reply[ICMP].type = 0 # echo-reply
reply[ICMP].seq = req[ICMP].seq
reply[ICMP].id = req[ICMP].id
# Force re-generation of the checksum
reply[ICMP].chksum = None
return reply
Nothing is actually swapped; the source IP address from the echo request is used as the destination for the echo reply. src in the echo reply is left unspecified, so it defaults to that of the outgoing interface
Codecov Report
Merging #4051 (c1aaa2b) into master (cdbdb15) will decrease coverage by
0.01%. The diff coverage isn/a.
@@ Coverage Diff @@
## master #4051 +/- ##
==========================================
- Coverage 81.91% 81.91% -0.01%
==========================================
Files 328 328
Lines 75494 75494
==========================================
- Hits 61841 61838 -3
- Misses 13653 13656 +3
Hi, did you find this confusing? I'm interested in why you bumped into this. Did you have a case where this was unexpected? Thanks !
Hi @gpotter2,
I was just reading the docs about using tun/tap (https://scapy.readthedocs.io/en/latest/layers/tuntap.html) when I ran into that.
Towards the bottom, it mentions "ICMPEcho_am swaps the source and destination fields of any Ether and IP headers...". Looking at the packets in Wireshark, I noticed that the behavior didn't quite match that description in the docs, so just thought of reporting it