-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use L3RawSocket(6) automatically on lo #4099
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4099 +/- ##
==========================================
+ Coverage 81.60% 81.96% +0.35%
==========================================
Files 328 328
Lines 75766 75867 +101
==========================================
+ Hits 61832 62183 +351
+ Misses 13934 13684 -250
|
9ac7bdc
to
db3db35
Compare
db3db35
to
19f7a16
Compare
While you are at it, could you remove the useless backtick at https://github.com/secdev/scapy/blob/master/doc/scapy/troubleshooting.rst?plain=1#L57 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool PR! On BSD*, the Loopback()
layer does a similar job, so we don't need to change anything.
19f7a16
to
cfc1d3e
Compare
cfc1d3e
to
6ccbb12
Compare
Setting iface= is the best thing to do. I was just wandering why you were changing thisSent from my iPhoneOn 21 Aug 2023, at 19:23, gpotter2 ***@***.***> wrote:
@gpotter2 commented on this pull request.
In doc/scapy/troubleshooting.rst:
@@ -50,11 +64,20 @@ With IPv6, you can simply do::
<IPv6 version=6 tc=0 fl=866674 plen=8 nh=ICMPv6 hlim=64 src=::1 dst=::1 |<ICMPv6EchoReply type=Echo Reply code=0 cksum=0x7ebb id=0x0 seq=0x0 |>>
# Layer 2
- >>> conf.iface = "lo"
- >>> srp1(Ether() / IPv6() / ICMPv6EchoRequest())
+ >>> srp1(Ether() / IPv6() / ICMPv6EchoRequest(), iface=conf.loopback_name)
I'm replacing the conf.iface = "lo" (line above), by iface= in the sniff itself. Do you think that's confusing?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've addressed your points ! Feel free to merge it if you think it's ready. |
Since we already have a mechanism for selecting the
L3socket
based on the interface (this was designed more towards special bluetooth/usb interfaces), we can very simply add a check to useL3RawSocket(6)
when using the loopback interface.This removes the necessity to use
conf.L3socket = L3RawSocket
when using loopback.I am however unsure if this is necessary on BSD/OSX. @guedou what do you think?