Closed Lopkop closed 1 month ago
This is expected. srp
can take an iface
argument.
@gpotter2 I actually passed iface
to srp
as an argument, that's the point of this issue. Did you check the code?
Your issue is that you are using the default interface.
If you use srp
, it uses a conf.L2socket
which filters outgoing traffic. That makes sense, you don't want to match what you are sending as a response. Your fake server response is marked as "OUTGOING", as it's coming out of the interface, therefore it is filtered by srp
. If you were running each scripts on different machines, it would work.
Use the loopback interface for your local testing.
Brief description
srp() function does not get a DHCPOFFER response from a self-written scapy dhcp server. While debugging I saw, that AsyncSniffer, that runs from this function
_sndrcv_rcv
in this filesendrecv.py
does not even catch that response packet. Then i addediface
argument in that sniffer and problem resolved.Scapy version
2.6.0
Python version
3.12.6
Operating system
Linux archlinux 6.6.52-1-lts
Additional environment information
No response
How to reproduce
iface=conf.iface
argument inself.sniffer._run
inside_sndrcv_rcv
function in the filesendrecv.py
.Actual result
If you want more details check out this: I sent DISCOVER request, but scapy's internal sniffer did not catch the offer response (that was sent):
Expected result
But if i add
iface=conf.iface
argument inself.sniffer._run
inside_sndrcv_rcv
function in this filesendrecv.py
, then we see the OFFER response by the server:Related resources
No response