Skip to content

mwan3: fix IPv6 support in tracking methods#28691

Open
harinworks wants to merge 3 commits intoopenwrt:masterfrom
harinworks:mwan3-ipv6-fix
Open

mwan3: fix IPv6 support in tracking methods#28691
harinworks wants to merge 3 commits intoopenwrt:masterfrom
harinworks:mwan3-ipv6-fix

Conversation

@harinworks
Copy link

@harinworks harinworks commented Mar 5, 2026

📦 Package Details

Maintainer: @feckert

Description:

  • mwan3: warn about unsupported IPv6 in arping track method
    ARP and arping do not support IPv6.

  • mwan3: fix IPv6 support for httping command
    This passes the '-6' option to httping if the address family is IPv6.


🧪 Run Testing Details

  • OpenWrt Version: N/A
  • OpenWrt Target/Subtarget: N/A
  • OpenWrt Device: N/A

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

ARP and arping do not support IPv6.

Signed-off-by: Harin Lee <me@harin.net>
This passes the '-6' option to httping if the address family is IPv6.

Signed-off-by: Harin Lee <me@harin.net>
@BKPepe BKPepe requested review from Copilot and feckert and removed request for feckert March 6, 2026 09:45
Copy link

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 improves mwan3 tracking behavior around IPv6 by preventing unsupported IPv6 use with arping and enabling IPv6 mode for httping.

Changes:

  • Reject arping as a track method when the configured address family is IPv6 (with a warning).
  • Pass -6 to httping when tracking an IPv6 target.

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

Comment on lines +321 to +323
WRAP httping $ipv6_opt -c $count -t $timeout -q "https://$track_ip" &> /dev/null &
else
WRAP httping -c $count -t $timeout -q "http://$track_ip" &> /dev/null &
WRAP httping $ipv6_opt -c $count -t $timeout -q "http://$track_ip" &> /dev/null &
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

httping URLs with IPv6 literals typically must be bracketed (e.g., http://[2001:db8::1]); using "http://$track_ip" will produce an invalid URL when track_ip is a raw IPv6 address. Consider wrapping track_ip in [] when it looks like an IPv6 literal (e.g., contains :) while leaving hostnames unchanged.

Copilot uses AI. Check for mistakes.
Comment on lines +329 to +331
WRAP httping $ipv6_opt -c $count -t $timeout "https://$track_ip" 2> /dev/null > $TRACK_OUTPUT &
else
WRAP httping -c $count -t $timeout "http://$track_ip" 2> /dev/null > $TRACK_OUTPUT &
WRAP httping $ipv6_opt -c $count -t $timeout "http://$track_ip" 2> /dev/null > $TRACK_OUTPUT &
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

httping URLs with IPv6 literals typically must be bracketed (e.g., http://[2001:db8::1]); using "http://$track_ip" will produce an invalid URL when track_ip is a raw IPv6 address. Consider wrapping track_ip in [] when it looks like an IPv6 literal (e.g., contains :) while leaving hostnames unchanged.

Copilot uses AI. Check for mistakes.
result=$?
;;
httping)
local ipv6_opt
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

ipv6_opt is conditionally assigned but never explicitly initialized; initializing it to an empty string (and keeping usage consistent) makes the intent clearer and avoids relying on shell-specific defaults if this code is ever refactored/moved.

Suggested change
local ipv6_opt
local ipv6_opt=""

Copilot uses AI. Check for mistakes.
@harinworks
Copy link
Author

harinworks commented Mar 6, 2026

Copilot was wrong. httping doesn't support bracketed IPv6 addresses. httping just throws a No valid IPv4 or IPv6 address found error when brackets are included in the URL. Also, I just kept the declaration of ipv6_opt as local ipv6_opt to maintain consistency with the other lines.

Signed-off-by: Harin Lee <me@harin.net>
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