-
Notifications
You must be signed in to change notification settings - Fork 5
RDK-59964 : ZeroConfig (IPv4LL) support for EntOS - AirPlay Devices #431
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
Conversation
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>
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 |
Copilot
AI
Jan 30, 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 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.
| NMdispatcherLog "Started avahi-autoipd for $iface" | ||
| /usr/sbin/avahi-autoipd --daemonize --syslog "$iface" |
Copilot
AI
Jan 30, 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 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).
| 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 |
| if [ "$interfaceStatus" == "dhcp4-change" ]; then | ||
| /usr/sbin/avahi-autoipd --kill "$interfaceName" 2>/dev/null | ||
| mode="ipv4" |
Copilot
AI
Jan 30, 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.
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).
| 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 |
Copilot
AI
Jan 30, 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 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.
| #!/bin/sh | ||
|
|
||
| #################################################################################### | ||
| # If not stated otherwise in this file or this component's LICENSE file the | ||
| # following copyright and licenses apply: |
Copilot
AI
Jan 30, 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.
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.
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