Skip to content

Conversation

@gururaajar
Copy link
Contributor

Reason for change: NetworkManager Dispatcher to launch avahi-autoipd to launch, when interface connected and clean-up IPv4LL when IPv4 is received.
Test Procedure: check whether link local IPv4 is assigned to wlan0 and eth0 when there is no valid IP.
Priority:P1
Risks: Medium

Reason for change: NetworkManager Dispatcher to launch avahi-autoipd to launch, when interface connected and clean-up IPv4LL when IPv4 is received.
Test Procedure: check whether link local IPv4 is assigned to wlan0 and eth0 when there is no valid IP.
Priority:P1
Risks: Medium
Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
@gururaajar gururaajar requested a review from a team as a code owner December 26, 2025 15:20
Reason for change: NetworkManager Dispatcher to launch avahi-autoipd to launch, when interface connected and clean-up IPv4LL when IPv4 is received.
Test Procedure: check whether link local IPv4 is assigned to wlan0 and eth0 when there is no valid IP.
Priority:P1
Risks: Medium
Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
Copilot AI review requested due to automatic review settings January 15, 2026 03:28
Copy link
Contributor

Copilot AI left a 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 adds IPv4 Link-Local (ZeroConfig) support for CentOS-based AirPlay devices using avahi-autoipd. When network interfaces connect without receiving a valid IPv4 address via DHCP, a link-local IPv4 address (169.254.x.x) is automatically assigned. The implementation uses NetworkManager dispatcher to manage the lifecycle of avahi-autoipd services.

Changes:

  • Added new script to start avahi-autoipd when network interfaces come up without global IPv4
  • Modified NetworkManager dispatcher to stop avahi-autoipd when DHCP IPv4 is received
  • Configured DHCP timeout behavior for eth0 interface to support ZeroConfig fallback

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lib/rdk/startLinkLocal.sh New script that launches avahi-autoipd service for eth0/wlan0 interfaces when no global IPv4 is present
lib/rdk/NM_Dispatcher.sh Added stop_zero_conf() function to clean up IPv4LL when DHCP IPv4 is acquired; adjusted DHCP timeout settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


interfaceName=$1

Log "From NM_preUp.sh $interfaceName"
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment references 'NM_preUp.sh' but this script is 'startLinkLocal.sh'. This should be corrected to reference the actual script name.

Suggested change
Log "From NM_preUp.sh $interfaceName"
Log "From startLinkLocal.sh $interfaceName"

Copilot uses AI. Check for mistakes.

Log()
{
echo "$(/bin/timestamp) : $0: $*" >> $LOG_FILE
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $LOG_FILE should be quoted to prevent word splitting and globbing issues if the path contains spaces or special characters. Use >> "$LOG_FILE" instead.

Suggested change
echo "$(/bin/timestamp) : $0: $*" >> $LOG_FILE
echo "$(/bin/timestamp) : $0: $*" >> "$LOG_FILE"

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +134
if [[ "$interfaceName" == "eth0" ]]; then
WiredConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$WiredConnectionUUID" ]; then
nmcli connection modify "$WiredConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block sets DHCP timeout to 0 when DHCP is received, but there's no comment explaining why this is necessary or how it relates to the ZeroConfig cleanup. Adding a comment would improve maintainability, especially since startLinkLocal.sh sets it to 'infinity'.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 15, 2026 03:43
Copy link
Contributor

Copilot AI left a 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 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +53
if [[ -n "$interfaceName" && ("$interfaceName" == "wlan0" || "$interfaceName" == "eth0") ]];then
if [[ "$interfaceName" == "eth0" ]];then
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition syntax mixes POSIX test construct with bash-specific double brackets. For consistency with the shebang '#!/bin/sh' and broader portability, consider using POSIX-compliant syntax: if [ -n \"$interfaceName\" ] && { [ \"$interfaceName\" = \"wlan0\" ] || [ \"$interfaceName\" = \"eth0\" ]; }; then

Suggested change
if [[ -n "$interfaceName" && ("$interfaceName" == "wlan0" || "$interfaceName" == "eth0") ]];then
if [[ "$interfaceName" == "eth0" ]];then
if [ -n "$interfaceName" ] && { [ "$interfaceName" = "wlan0" ] || [ "$interfaceName" = "eth0" ]; }; then
if [ "$interfaceName" = "eth0" ]; then

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +53
if [[ -n "$interfaceName" && ("$interfaceName" == "wlan0" || "$interfaceName" == "eth0") ]];then
if [[ "$interfaceName" == "eth0" ]];then
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition uses bash-specific double brackets and '==' operator. For consistency with the shebang '#!/bin/sh' and broader portability, use POSIX-compliant syntax: if [ \"$interfaceName\" = \"eth0\" ]; then

Suggested change
if [[ -n "$interfaceName" && ("$interfaceName" == "wlan0" || "$interfaceName" == "eth0") ]];then
if [[ "$interfaceName" == "eth0" ]];then
if [ -n "$interfaceName" ] && { [ "$interfaceName" = "wlan0" ] || [ "$interfaceName" = "eth0" ]; }; then
if [ "$interfaceName" = "eth0" ]; then

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +141
if [[ "$interfaceName" == "eth0" ]]; then
WiredConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$WiredConnectionUUID" ]; then
nmcli connection modify "$WiredConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi
if [[ "$interfaceName" == "wlan0" ]]; then
WifiConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$WifiConnectionUUID" ]; then
nmcli connection modify "$WifiConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code block contains significant duplication - the same logic is repeated for both eth0 and wlan0. Consider consolidating this into a single block that executes for both interfaces, reducing code duplication and improving maintainability.

Suggested change
if [[ "$interfaceName" == "eth0" ]]; then
WiredConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$WiredConnectionUUID" ]; then
nmcli connection modify "$WiredConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi
if [[ "$interfaceName" == "wlan0" ]]; then
WifiConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$WifiConnectionUUID" ]; then
nmcli connection modify "$WifiConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi
if [[ "$interfaceName" == "eth0" || "$interfaceName" == "wlan0" ]]; then
ConnectionUUID=$(nmcli -t -f UUID,DEVICE connection show --active | grep ":$interfaceName$" | cut -d: -f1)
if [ -n "$ConnectionUUID" ]; then
nmcli connection modify "$ConnectionUUID" ipv4.dhcp-timeout 0
nmcli device reapply "$interfaceName"
fi
fi

Copilot uses AI. Check for mistakes.

if [ "x$interfaceName" != "x" ] && [ "$interfaceName" != "lo" ]; then
if [ "$interfaceStatus" == "dhcp4-change" ]; then
if [[ "$interfaceName" == "eth0" ]]; then
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition uses bash-specific double brackets and '==' operator. For consistency with the shebang '#!/bin/sh' in this file and broader portability, use POSIX-compliant syntax: if [ \"$interfaceName\" = \"eth0\" ]; then

Copilot uses AI. Check for mistakes.
nmcli device reapply "$interfaceName"
fi
fi
if [[ "$interfaceName" == "wlan0" ]]; then
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition uses bash-specific double brackets and '==' operator. For consistency with the shebang '#!/bin/sh' in this file and broader portability, use POSIX-compliant syntax: if [ \"$interfaceName\" = \"wlan0\" ]; then

Copilot uses AI. Check for mistakes.
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.

2 participants