-
Notifications
You must be signed in to change notification settings - Fork 8.3k
net: mqtt_sn: Improve IPv6 support #99927
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errno returns a positive value, while the API specifies that a negative value is returned in case of error. Therefore replaces "return errno" by "return -errno". Signed-off-by: Aurelien Jarno <[email protected]>
aurel32
commented
Nov 24, 2025
0a4c656 to
fcb046d
Compare
jukkar
reviewed
Nov 25, 2025
Member
jukkar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can ignore the Sonar warning, the tp_udp_init() looks ok to me.
fcb046d to
29f7d31
Compare
The current allocated buffer for storing the IP address is not always large enough to hold an IPv6 address. Instead of using a hard-coded value, use NET_INET6_ADDRSTRLEN, which covers all cases, including possible mapped IPv4 addresses. Signed-off-by: Aurelien Jarno <[email protected]>
On IPv6, the host is subscribed to a few multicast addresses by default. Reusing such an address for MQTT-SN leads to an EALREADY error. Ignore this error instead of returning. Do the same for IPv4 for consistency, and because it could happen if the multicast address has already been added manually from another part of the code, although this is really a corner case. Signed-off-by: Aurelien Jarno <[email protected]>
On IPv6, IPPROTO_IPV6 needs to be replaced by IPPROTO_IP and IP_MULTICAST_TTL by IPV6_MULTICAST_HOPS. Signed-off-by: Aurelien Jarno <[email protected]>
29f7d31 to
3feeea6
Compare
rlubos
previously approved these changes
Nov 26, 2025
3feeea6 to
9b5bbb2
Compare
|
rlubos
approved these changes
Nov 27, 2025
jukkar
approved these changes
Nov 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This PR fixes various issues I've found in the MQTT-SN code when trying to get it working with IPv6. I can't split in in smaller chunks if needed