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

sendmsg invalid argument on udp connections with go-coap version >= 3.2.0 #581

Closed
kgoguevvoi opened this issue Sep 16, 2024 · 4 comments · Fixed by #582
Closed

sendmsg invalid argument on udp connections with go-coap version >= 3.2.0 #581

kgoguevvoi opened this issue Sep 16, 2024 · 4 comments · Fixed by #582
Assignees
Labels
bug Something isn't working

Comments

@kgoguevvoi
Copy link

When attempting to upgrade our server which relies on go-coap v2 to v3 (latest) we encountered an issue with udp connections not being able to be written to from the server. As an attempt to check if the latest code is working we resorted to using the simple coap example bundled with the repository. When running the server and the client we are met with sendmsg: invalid argument on versions >= 3.2.0

The issue is not present on tag v3.1.6. However this presents issues for anyone that wants to use the latest version of the go-coap library.

The issue has been tested on the following platforms

* Linux 6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
* Linux 6.10.9-arch1-2 #1 SMP PREEMPT_DYNAMIC Tue, 10 Sep 2024 14:37:32 +0000 x86_64 GNU/Linux

How to reproduce:

  1. Checkout the tag 3.2.0 and run the simple example server then client
  2. Server fails to respond to client with invalid argument
2024/09/16 15:31:27 ClientAddress 127.0.0.1:52765, Code: GET, Token: 0ab50dc5d0fdc417, Path: /a, Type: Confirmable, MessageID: 45080
udp: cannot write response: cannot write request: write udp [::]:5688->127.0.0.1:52765: sendmsg: invalid argument
2024/09/16 15:31:28 Error sending request: cannot write request: cannot write request: context deadline exceeded
exit status 1

  1. Checkout the tag 3.1.6 and run the simple example server then client
  2. Server responds as expected:
2024/09/16 15:36:41 ClientAddress 127.0.0.1:52530, Code: GET, Token: f29a0fd787cdc463, Path: /a, Type: Confirmable, MessageID: 53194
2024/09/16 15:36:41 Response payload: Code: Content, Token: f29a0fd787cdc463, ContentFormat: text/plain; charset=utf-8, Type: Acknowledgement, MessageID: 53194, PayloadLen: 11

Expected:
No error on server side with go-coap versions > 3.1.6

@jlevesy
Copy link

jlevesy commented Sep 16, 2024

@jkralik
Copy link
Member

jkralik commented Sep 17, 2024

Hi @jlevesy and @kgoguevvoi. Pls could you test if #582 fixes the issue ?

@jkralik jkralik self-assigned this Sep 17, 2024
@jkralik jkralik added the bug Something isn't working label Sep 17, 2024
@kgoguevvoi
Copy link
Author

Hi @jkralik yes will test it tomorrow and get back to you, thank you for looking into it

@jlevesy
Copy link

jlevesy commented Sep 18, 2024

Just tried it. It does work! Thanks a lot for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants