Skip to content

fixed KeyError on timessent in sndrcv when an error happens during a send #1937

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

Closed
wants to merge 2 commits into from

Conversation

epozzobon
Copy link
Contributor

Currently, in sndrcv, when an error happens during the send operation it gets logged and execution continues. However, since timessent is not populated, a KeyError will be raised at the line p.sent_time = timessent[i]. I added a check to verify that the key is present in the timessent dict.
This PR also fixes ISOTPSoftSocket.sr1 not returning after the specified timeout, and I added 2 unit tests for that.

@codecov
Copy link

codecov bot commented Mar 26, 2019

Codecov Report

Merging #1937 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1937      +/-   ##
==========================================
- Coverage   86.35%   86.35%   -0.01%     
==========================================
  Files         196      196              
  Lines       44339    44340       +1     
==========================================
- Hits        38290    38289       -1     
- Misses       6049     6051       +2
Impacted Files Coverage Δ
scapy/sendrecv.py 85.81% <100%> (+0.36%) ⬆️
scapy/contrib/isotp.py 88.31% <100%> (ø) ⬆️
scapy/autorun.py 78.51% <0%> (-4.14%) ⬇️
scapy/config.py 85.71% <0%> (-0.9%) ⬇️
scapy/asn1/ber.py 83.09% <0%> (+0.28%) ⬆️
scapy/supersocket.py 72.48% <0%> (+0.38%) ⬆️
scapy/layers/tls/record.py 92.1% <0%> (+0.87%) ⬆️

@epozzobon epozzobon marked this pull request as ready for review March 26, 2019 17:08
@gpotter2
Copy link
Member

gpotter2 commented Jun 1, 2019

Thanks for the PR & sorry for the late reply.
This entire mechanic will be changed in #1999, for efficiency, therefore I hope you don't mind if we don't merge this one :)

@guedou
Copy link
Member

guedou commented Jun 10, 2019

@gpotter2 should we close this PR?

@gpotter2
Copy link
Member

It will be closed by #1999

@guedou
Copy link
Member

guedou commented Jun 10, 2019

OK, I will close it as this PR will never be merged.

@guedou guedou closed this Jun 10, 2019
@epozzobon epozzobon deleted the fix-isotp-sr1-timeout branch January 23, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants