Skip to content
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

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Conversation

gpotter2
Copy link
Member

@gpotter2 gpotter2 commented Aug 20, 2023

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 use L3RawSocket(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?

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #4099 (6ccbb12) into master (204605b) will increase coverage by 0.35%.
Report is 5 commits behind head on master.
The diff coverage is 94.28%.

@@            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     
Files Changed Coverage Δ
scapy/interfaces.py 96.50% <85.71%> (-0.93%) ⬇️
scapy/config.py 84.41% <100.00%> (+0.18%) ⬆️
scapy/sendrecv.py 88.27% <100.00%> (+0.32%) ⬆️

... and 15 files with indirect coverage changes

@guedou
Copy link
Member

guedou commented Aug 21, 2023

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 ?

Copy link
Member

@guedou guedou left a 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.

doc/scapy/troubleshooting.rst Show resolved Hide resolved
scapy/sendrecv.py Outdated Show resolved Hide resolved
@guedou
Copy link
Member

guedou commented Aug 22, 2023 via email

@gpotter2
Copy link
Member Author

I've addressed your points ! Feel free to merge it if you think it's ready.

@guedou guedou merged commit 0bc40c6 into secdev:master Aug 26, 2023
19 checks passed
@gpotter2 gpotter2 deleted the iface-routing branch September 11, 2023 17:09
@gpotter2 gpotter2 added this to the 2.6.0 milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants