-
Notifications
You must be signed in to change notification settings - Fork 10
RDK-60375 : ZeroConfig (IPv4LL) support for EntOS - AirPlay Devices #270
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
base: develop
Are you sure you want to change the base?
Conversation
…evices Reason for Change: As Gnome networkmanager is clearing of the link local IP address periodically after cheking for dhcp. We made the DHCP timeout of IPv4 to infinity. So that Gnome networkmanager won't delete the link local IP Test Procedure: Check link local IP assigned persist after assigned Priority:P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
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.
Pull request overview
This PR implements ZeroConfig (IPv4LL) support for CentOS AirPlay devices by setting the DHCP timeout to infinity for IPv4 configurations. This prevents Gnome NetworkManager from periodically clearing link-local IP addresses when checking for DHCP.
Changes:
- Sets NM_SETTING_IP_CONFIG_DHCP_TIMEOUT to 2147483647 (infinite) for IPv4 configuration in WiFi connections
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL); // autoconf = true | ||
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, hostname.c_str(), NULL); | ||
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, TRUE, NULL); // hostname send enabled | ||
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout |
Copilot
AI
Jan 23, 2026
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.
Consider using INT32_MAX constant instead of the hardcoded value 2147483647. This would improve code clarity and maintainability. If INT32_MAX is not available, add a comment explaining that this is the maximum value for a 32-bit signed integer, which NetworkManager treats as infinite timeout.
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.
addressed
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, NULL); // autoconf = true | ||
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, hostname.c_str(), NULL); | ||
| g_object_set(G_OBJECT(sIpv6Conf), NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, TRUE, NULL); // hostname send enabled | ||
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout |
Copilot
AI
Jan 23, 2026
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.
The DHCP timeout is being set on sIpv4Conf after it has already been added to the connection (line 735). This means the timeout setting may not take effect. The timeout should be set before calling nm_connection_add_setting for sIpv4Conf. Move this line to be between lines 734 and 735, before the nm_connection_add_setting call.
…evices Reason for Change: As Gnome networkmanager is clearing of the link local IP address periodically after cheking for dhcp. We made the DHCP timeout of IPv4 to infinity. So that Gnome networkmanager won't delete the link local IP Test Procedure: Check link local IP assigned persist after assigned Priority:P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
…r into topic/RDK-60375
…r into topic/RDK-60375
…r into topic/RDK-60375
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if only link-local IPv4 is available (169.254.x.x) | ||
| if(!result.ipaddress.empty() && result.ipaddress.compare(0, 8, "169.254.") == 0) | ||
| { | ||
| NMLOG_WARNING("Only link-local IPv4 available on %s, not returning it", interface.c_str()); | ||
| result.ipaddress.clear(); | ||
| result.prefix = 0; | ||
| result.gateway.clear(); | ||
| result.primarydns.clear(); | ||
| result.secondarydns.clear(); | ||
| result.dhcpserver.clear(); | ||
| } |
Copilot
AI
Jan 23, 2026
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.
The cache for IP addresses (m_ethIPv4Address and m_wlanIPv4Address) is checked before the link-local filtering logic. This means that once a link-local address is cached (before it gets cleared by the filtering logic), subsequent calls will return the cached link-local address, creating inconsistent behavior. The cache should either be updated after the filtering logic, or the filtering should happen before caching at line 745-748.
| // Check if only link-local IPv4 is available (169.254.x.x) | ||
| if(!result.ipaddress.empty() && result.ipaddress.compare(0, 8, "169.254.") == 0) | ||
| { | ||
| NMLOG_WARNING("Only link-local IPv4 available on %s, not returning it", interface.c_str()); | ||
| result.ipaddress.clear(); | ||
| result.prefix = 0; | ||
| result.gateway.clear(); | ||
| result.primarydns.clear(); | ||
| result.secondarydns.clear(); | ||
| result.dhcpserver.clear(); | ||
| } |
Copilot
AI
Jan 23, 2026
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.
The new link-local IP address filtering logic lacks test coverage. Given that there are comprehensive tests for GetIPSettings in tests/l2Test/libnm/l2_test_libnmproxy.cpp, a test case should be added to verify that link-local addresses (169.254.x.x) are correctly handled according to the intended behavior. This is especially important given that this filtering logic significantly changes the API behavior.
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); // autoconf = true | ||
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, hostname.c_str(), NULL); | ||
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, TRUE, NULL); // hostname send enabled | ||
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout |
Copilot
AI
Jan 23, 2026
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.
The DHCP timeout is only being set for WiFi connections, but not for Ethernet connections. According to the PR description, this change is for ZeroConfig (IPv4LL) support which should apply to all network interfaces, not just WiFi. The createMinimalEthernetConnection function (lines 528-576) also creates IPv4 DHCP configuration but lacks the NM_SETTING_IP_CONFIG_DHCP_TIMEOUT setting. For consistency and to achieve the stated goal, the same infinite timeout should be applied to Ethernet connections as well.
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout | |
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout | |
| g_object_set(G_OBJECT(sIpv4Conf), NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, 2147483647, NULL); // 2147483647 = infinite timeout |
| // Check if only link-local IPv4 is available (169.254.x.x) | ||
| if(!result.ipaddress.empty() && result.ipaddress.compare(0, 8, "169.254.") == 0) | ||
| { | ||
| NMLOG_WARNING("Only link-local IPv4 available on %s, not returning it", interface.c_str()); | ||
| result.ipaddress.clear(); | ||
| result.prefix = 0; | ||
| result.gateway.clear(); | ||
| result.primarydns.clear(); | ||
| result.secondarydns.clear(); | ||
| result.dhcpserver.clear(); | ||
| } |
Copilot
AI
Jan 23, 2026
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.
This code filters out link-local IPv4 addresses (169.254.x.x) from being returned to API consumers. However, this directly contradicts the PR's stated objective which is to "support ZeroConfig (IPv4LL)" for AirPlay devices. IPv4LL (IPv4 Link-Local) addresses are precisely the 169.254.x.x range that's being filtered out here. If the goal is to support ZeroConfig/IPv4LL, these addresses should be preserved and returned, not hidden. This change appears to break the very functionality the PR claims to implement.
| // Check if only link-local IPv4 is available (169.254.x.x) | |
| if(!result.ipaddress.empty() && result.ipaddress.compare(0, 8, "169.254.") == 0) | |
| { | |
| NMLOG_WARNING("Only link-local IPv4 available on %s, not returning it", interface.c_str()); | |
| result.ipaddress.clear(); | |
| result.prefix = 0; | |
| result.gateway.clear(); | |
| result.primarydns.clear(); | |
| result.secondarydns.clear(); | |
| result.dhcpserver.clear(); | |
| } | |
| // IPv4 link-local (169.254.x.x) addresses are now preserved to support ZeroConfig/IPv4LL. |
Reason for Change: As Gnome networkmanager is clearing of the link local IP address periodically after cheking for dhcp. We made the DHCP timeout of IPv4 to infinity. So that Gnome networkmanager won't delete the link local IP
Test Procedure: Check link local IP assigned persist after assigned
Priority:P1
Risks: Medium