scapy
scapy copied to clipboard
srp not receiving answers after upgrading from version 2.4 to 2.5
Brief description
I upgraded scapy version from 2.4 to 2.5.0.dev130 on Ubuntu. Now I get 0 answers
Scapy version
2.5.0.dev130
Python version
3.8.10
Operating system
Ubuntu 20.04.6 LTS (Focal Fossa
Additional environment information
Connect from one machine to another ipv6 enabled machine and interface
How to reproduce
#test 2 - version 6 positive test ans,unans=scapy.srp(scapy.Ether(dst=mac)/scapy.IPv6(dst=v6dst,version=6)/scapy.ICMPv6EchoRequest(id=1,seq=1),iface=interface,timeout=2)
received_reply = False for request, receive in ans: if receive.haslayer(scapy.ICMPv6EchoReply): received_reply = True break if received_reply: print("Response to IPv6 version # of 6 - PASS") output = ans.summary() else: print("No response to IPv6 version # of 6 - FAIL") time.sleep(2)
Actual result
With version 2.4 Got response Received 1 packets, got 1 answers, remaining 1 packets
With version 2.5 Received 1 packets, got 0 answers, remaining 1 packets
Expected result
Received 1 packets, got 1 answers, remaining 1 packets
Related resources
does running sr() instead srp() have the same result?
Yes sr() has the same issue as srp()
Both versions 2.4 and 2.5 do not recognize an answer when an extension header like hop by hop header or destination header is sent as echo request. Adding some debugging statements found that the hash values do not match in https://github.com/secdev/scapy/blob/master/scapy/sendrecv.py#L276 therefore the result is returned as 0 answers