Skip to content

Smarter interface selection when sending one packet #2108

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

Merged
merged 1 commit into from
Jul 2, 2019

Conversation

guedou
Copy link
Member

@guedou guedou commented Jun 27, 2019

This PR fixes #1975.

sr() and srloop() are not candidates for this fix as they could be used to send packets to destinations available from different network interfaces. I do not think that it is a good idea to iterate over packets to select the interface, then to iterate again to send them.

@guedou
Copy link
Member Author

guedou commented Jun 27, 2019

An alternative implementation could be to use a disctinct socket per interface. It likely means to open socket inside SndRcvHandler()

@gpotter2 gpotter2 mentioned this pull request Jun 29, 2019
27 tasks
@codecov
Copy link

codecov bot commented Jul 1, 2019

Codecov Report

Merging #2108 into master will decrease coverage by <.01%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #2108      +/-   ##
==========================================
- Coverage    87.2%   87.19%   -0.01%     
==========================================
  Files         197      197              
  Lines       44506    44515       +9     
==========================================
+ Hits        38810    38816       +6     
- Misses       5696     5699       +3
Impacted Files Coverage Δ
scapy/sendrecv.py 84.27% <66.66%> (-0.27%) ⬇️
scapy/arch/pcapdnet.py 68.62% <0%> (-1.04%) ⬇️
scapy/layers/inet6.py 88.1% <0%> (-0.18%) ⬇️
scapy/layers/inet.py 72.82% <0%> (+0.08%) ⬆️
scapy/supersocket.py 73.1% <0%> (+0.37%) ⬆️
scapy/automaton.py 85.98% <0%> (+0.54%) ⬆️

@guedou
Copy link
Member Author

guedou commented Jul 1, 2019

@gpotter2 ready to be merged

@guedou
Copy link
Member Author

guedou commented Jul 1, 2019

@gpotter2 thanks! I applied your comments.

@gpotter2
Copy link
Member

gpotter2 commented Jul 1, 2019

Maybe this could be applied to send() too ?

@guedou
Copy link
Member Author

guedou commented Jul 2, 2019

@gpotter2 may answer will be the same as my two first comments. send() can send packets to different addresses, it does not make much senses to apply this to somehting else than sr1().

@gpotter2
Copy link
Member

gpotter2 commented Jul 2, 2019

Got it. All Good to me then

@guedou guedou merged commit 4872816 into secdev:master Jul 2, 2019
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.

Packet Send function doesn't respect routing for private subnets in multi-interface environments
2 participants