RDKEMW-14910: IPv6 ULA field in network interface API response#294
RDKEMW-14910: IPv6 ULA field in network interface API response#294cmuhammedrafi wants to merge 13 commits intodevelopfrom
Conversation
returns Link-Local address instead of ULA address
There was a problem hiding this comment.
Pull request overview
This PR fixes the IPv6 ula value returned by the Network Interface API by identifying IPv6 Unique Local Addresses (ULA, fc00::/7) instead of incorrectly treating link-local (fe80::/10) addresses as ULA.
Changes:
- Update IPv6 address parsing to classify
fc*/fd*addresses as ULA and skipfe80*link-local addresses. - Adjust IPv6 address-change event filtering to ignore ULA addresses.
- Update the libnm proxy unit test to include a ULA address and validate the
ulafield in the response.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/l2Test/libnm/l2_test_libnmproxy.cpp | Extends IPv6 test data and expectations to validate ula is populated from a ULA address. |
| plugin/gnome/NetworkManagerGnomeProxy.cpp | Fixes IPv6 ULA detection logic and improves logging/message spelling. |
| plugin/gnome/NetworkManagerGnomeEvents.cpp | Filters out ULA addresses from IPv6 address-change notifications. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Instead of checking the ipaddress range, can we return only Global IPs that are not of ULA Type? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(ipaddr != NULL) { | ||
| std::string ipAddress = ipaddr; | ||
| if (ipAddress.compare(0, 5, "fe80:") == 0 || | ||
| ipAddress.compare(0, 6, "fe80::") == 0) { | ||
| NMLOG_DEBUG("%s It's link-local ip", ipAddress.c_str()); | ||
| continue; // It's link-local so skiping | ||
| if(ipAddress[0] != '2' && ipAddress[0] != '3') | ||
| { | ||
| // Global Unicast Address (RFC 4291, 2000::/3) | ||
| // 2000::/3 covers first bytes 0x20-0x3f, which in hex string always starts with '2' or '3'. | ||
| NMLOG_DEBUG("%s Not a global unicast address", ipAddress.c_str()); | ||
| continue; |
There was a problem hiding this comment.
ipAddress[0] is accessed without checking ipAddress is non-empty. If nm_ip_address_get_address() returns an empty string (or something that becomes empty after conversion), this is undefined behavior and can crash. Add an ipAddress.empty() guard before indexing.
Reason for change: Fix ULA field error