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

fix(coap-server): ignore incoming requests with an invalid source port #1188

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Dec 10, 2023

Resolves #1182.

This is more like a workaround for now to fix the crashes immediately but should be fixed at the library level eventually.

Copy link

codecov bot commented Dec 10, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (be1fd88) 76.66% compared to head (ba92879) 76.65%.
Report is 7 commits behind head on master.

Files Patch % Lines
packages/binding-coap/src/coap-server.ts 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1188      +/-   ##
==========================================
- Coverage   76.66%   76.65%   -0.02%     
==========================================
  Files          80       80              
  Lines       16813    16821       +8     
  Branches     1618     1619       +1     
==========================================
+ Hits        12890    12894       +4     
- Misses       3893     3897       +4     
  Partials       30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@relu91
Copy link
Member

relu91 commented Dec 11, 2023

What happens to the ignored request? Do clients try to send another request? Also I'd add a followup issue to revert the change once it is solved in node-coap.

@JKRhb
Copy link
Member Author

JKRhb commented Dec 11, 2023

What happens to the ignored request? Do clients try to send another request?

If the request is confirmable, then clients will try to retransmit it until it has timed out. Usually, you could inform them that their request was unable to be processed by sending a reset message – but in this case, that is not possible as we would be running into the same problem again :/

Also I'd add a followup issue to revert the change once it is solved in node-coap.

That sounds good!

@JKRhb JKRhb changed the title fix(coap-server): ignore incoming messages with an invalid source port fix(coap-server): ignore incoming requests with an invalid source port Dec 11, 2023
Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go.

@danielpeintner
Copy link
Member

Also I'd add a followup issue to revert the change once it is solved in node-coap.

That sounds good!

Created #1190

Copy link
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a suggestion see below...

Since it is a temporary fix I am okay either way

packages/binding-coap/src/coap-server.ts Outdated Show resolved Hide resolved
@danielpeintner danielpeintner merged commit f22fe0c into eclipse-thingweb:master Dec 12, 2023
12 checks passed
@JKRhb JKRhb deleted the fix-coap-server branch December 12, 2023 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CoapServer crashes with RangeError [ERR_SOCKET_BAD_PORT]
3 participants