mwan3: fix IPv6 support in tracking methods#28691
mwan3: fix IPv6 support in tracking methods#28691harinworks wants to merge 3 commits intoopenwrt:masterfrom
Conversation
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>
There was a problem hiding this comment.
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
arpingas a track method when the configured address family is IPv6 (with a warning). - Pass
-6tohttpingwhen tracking an IPv6 target.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 & |
There was a problem hiding this comment.
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.
| 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 & |
There was a problem hiding this comment.
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.
| result=$? | ||
| ;; | ||
| httping) | ||
| local ipv6_opt |
There was a problem hiding this comment.
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.
| local ipv6_opt | |
| local ipv6_opt="" |
|
Copilot was wrong. httping doesn't support bracketed IPv6 addresses. httping just throws a |
Signed-off-by: Harin Lee <me@harin.net>
a084751 to
52d2a50
Compare
📦 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
✅ Formalities