* fix: select correct primary IPv6 address whose subnet contains the gateway
When a system has multiple IPv6 addresses with different prefix lengths
(e.g., /44 and /96), the script previously selected the first address
as primary regardless of whether its subnet contained the default gateway.
This caused the gateway to be unreachable after reinstallation.
This change:
- Adds pure shell expand_ipv6 and ip_addr_contains_gw functions to
determine which IPv6 subnet contains the gateway (no python dependency)
- Modifies collect_netconf to select the correct primary IPv6 address
- Stores remaining addresses as ipv6_extra_addrs
- Adds extra IPv6 addresses via post-up in create_ifupdown_config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address review feedback for IPv6 extra addrs and edge cases
- Pass ipv6_extra_addrs through initrd-network.sh (receive as $7,
add extra addresses in add_missing_ipv6_config, write to netconf)
so that trans.sh can read them via get_netconf_to
- Fix cut -c1-0 error when prefix_len < 4 in ip_addr_contains_gw
- Use grep -Fxve for exact string matching instead of regex
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: use subshell for IFS modification to avoid leaking to outer scope
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: avoid global IFS modification when iterating extra IPv6 addresses
Replace subshell IFS trick with tr+while read to split comma-separated
ipv6_extra_addrs, avoiding any modification of the IFS variable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: use ip route get instead of subnet matching for IPv6 primary address selection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>