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 handling ICMP Port Unreachable messages #356

Merged
merged 1 commit into from
Jun 4, 2019

Conversation

mrdeep1
Copy link
Collaborator

@mrdeep1 mrdeep1 commented Jun 3, 2019

Once a ICMP Port Unreachable message is received, the session is
disconnected by a call to coap_session_disconnect(). However if the session
is of type CON, the logic currently tries to retransmit the packet, but
nothing gets sent out.

src/coap_session.c:

Make sure that any entries on the context->sendqueue for the disconnected
session are removed.

examples/client.c:

Add in a Nack handler so that the client immediately exits on the session
disconnect. Additionally this also tidies up the exit after transmission
retries.

Fixes the issue picked up by #347

Once a ICMP Port Unreachable message is received, the session is
disconnected by a call to coap_session_disconnect().  However if the session
is of type CON,  the logic currently tries to retransmit the packet, but
nothing gets sent out.

src/coap_session.c:

Make sure that any entries on the context->sendqueue for the disconnected
session are removed.

examples/client.c:

Add in a Nack handler so that the client immediately exits on the session
disconnect.  Additionally this also tidies up the exit after transmission
retries.
@obgm obgm merged commit 1a5f75e into obgm:develop Jun 4, 2019
@mrdeep1 mrdeep1 deleted the no_listening_server branch June 4, 2019 14:18
@lewixliu
Copy link
Contributor

lewixliu commented Jun 4, 2019

It's into RST case in NACK handler on both scenarios:

  1. ICMP Port Unreachable message is received
  2. Server reply RST message.
    Is it a way to separate them?

Thanks!

@mrdeep1
Copy link
Collaborator Author

mrdeep1 commented Jun 4, 2019

I need to think this through. Differentiating between the 2 makes some sense and have some code now that does just that.

However, I was reminded of #131 where ICMP diagnostic messages can be transient and so UDP should be retrying where appropriate, including restarting DTLS if appropriate. I have not got the DTLS part working yet.

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.

3 participants