Skip to content

Conversation

@gururaajar
Copy link
Contributor

Reason for change: Start avahi-autoipd once the interface is up and delete the same when there is valid global IP.
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 ESRGururaja_ErodeSriranganRamlingham@comcast.com

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>
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 27, 2026 22:07
@gururaajar gururaajar requested a review from a team as a code owner January 27, 2026 22:07
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

AravindanNC
AravindanNC previously approved these changes Jan 28, 2026
Copilot AI review requested due to automatic review settings January 28, 2026 19:19
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 7 comments.


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

bpunnuru
bpunnuru previously approved these changes Jan 30, 2026
AravindanNC
AravindanNC previously approved these changes Jan 30, 2026
Copilot AI review requested due to automatic review settings January 30, 2026 15:15
@gururaajar gururaajar dismissed stale reviews from AravindanNC and bpunnuru via 0625522 January 30, 2026 15:15
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 +170 to +179
if [ "$interfaceStatus" = "connectivity-change" ] && [ -z "$interfaceName" ]; then
NMdispatcherLog "Global connectivity-change - checking all interfaces"
for iface in $ETHERNET_INTERFACE $WIFI_INTERFACE; do
# Skip if interface doesn't exist
if [ ! -e "/sys/class/net/$iface" ]; then
continue
fi
# Check carrier state
CARRIER=$(cat /sys/class/net/$iface/carrier 2>/dev/null || echo "0")
if [ "$CARRIER" = "0" ]; then
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The new connectivity-change handler starts avahi-autoipd based only on carrier state. This can (a) start avahi-autoipd even when the interface already has a valid non-link-local IPv4, and (b) miss the intended behavior of starting link-local only when there is no global IPv4. Consider checking the current IPv4 address state (e.g., presence of a non-169.254 inet address) before starting, and only start autoipd when there is no valid IPv4 address on the interface.

Copilot uses AI. Check for mistakes.
Comment on lines +186 to +187
NMdispatcherLog "Started avahi-autoipd for $iface"
/usr/sbin/avahi-autoipd --daemonize --syslog "$iface"
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The log message says "Started avahi-autoipd" before the command is executed. If avahi-autoipd fails to start, logs will be misleading. Log after confirming the command succeeded (or log failures separately).

Suggested change
NMdispatcherLog "Started avahi-autoipd for $iface"
/usr/sbin/avahi-autoipd --daemonize --syslog "$iface"
if /usr/sbin/avahi-autoipd --daemonize --syslog "$iface"; then
NMdispatcherLog "Started avahi-autoipd for $iface"
else
NMdispatcherLog "Failed to start avahi-autoipd for $iface"
fi

Copilot uses AI. Check for mistakes.
Comment on lines 201 to 203
if [ "$interfaceStatus" == "dhcp4-change" ]; then
/usr/sbin/avahi-autoipd --kill "$interfaceName" 2>/dev/null
mode="ipv4"
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

avahi-autoipd is killed unconditionally on every dhcp4-change before verifying the new IPv4 is actually a valid global address. If the dhcp4-change corresponds to a 169.254/16 IPv4LL assignment (the case this PR is trying to support), this will immediately kill link-local. Consider killing only when the acquired IPv4 is non-link-local (e.g., after parsing ipaddr and confirming it is not 169.254/16).

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +45
if [ -f /etc/device.properties ];then
. /etc/device.properties
fi

LOG_FILE="/opt/logs/NMMonitor.log"

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

INTERFACE="$1"

# Validate input and restrict to eth0 or wlan0
if [ -z "$INTERFACE" ]; then
Log "ERROR: No interface specified"
exit 1
fi

if [ "$INTERFACE" != "$ETHERNET_INTERFACE" ] && [ "$INTERFACE" != "$WIFI_INTERFACE" ]; then
Log "INFO: Link-local not started for $INTERFACE (only eth0 and wlan0 allowed)"
exit 0
fi
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

This script’s allowlist check relies on $ETHERNET_INTERFACE and $WIFI_INTERFACE coming from /etc/device.properties, but that file is sourced only if it exists. If /etc/device.properties is missing or doesn’t define these variables, the allowlist condition will reject all non-empty interfaces and link-local will never start. Consider providing safe defaults (e.g., eth0/wlan0) or explicitly erroring when the variables are unset.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
#!/bin/sh

####################################################################################
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

startLinkLocal.sh is not referenced anywhere in this repository (no callers found). If it’s intended to be invoked by NetworkManager dispatcher hooks or a systemd unit, that integration doesn’t appear to be included in this PR; otherwise this becomes orphaned/dead code. Either add the invocation/wiring in the repo, or remove the script and keep the logic in NM_Dispatcher.sh only.

Copilot uses AI. Check for mistakes.
@nhanasi nhanasi merged commit 73181a5 into develop Jan 30, 2026
11 of 12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDK-60375 : ZeroConfig (IPv4LL) support for EntOS - AirPlay Devices

5 participants