From 3a460f90043a9d4922b078c780290e74d5bba451 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 28 Mar 2025 00:13:22 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=98=AF=E9=9D=99=E6=80=81=20IPv6=20=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E4=BB=8E=20RA=20=E8=8E=B7=E5=8F=96=E5=88=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=BD=91=E5=85=B3=E7=9A=84=E6=83=85=E5=86=B5=20#298?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- initrd-network.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/initrd-network.sh b/initrd-network.sh index 54a7ae2..0ba37bb 100644 --- a/initrd-network.sh +++ b/initrd-network.sh @@ -426,8 +426,10 @@ if ! $ipv4_has_internet && add_missing_ipv4_config test_internet fi +# 有可能是静态 IPv6 但能从 RA 获取到网关,因此加上 || $ra_has_gateway if ! $ipv6_has_internet && - $dhcpv6_or_slaac && [ -n "$ipv6_addr" ] && [ -n "$ipv6_gateway" ] && + { $dhcpv6_or_slaac || $ra_has_gateway; } && + [ -n "$ipv6_addr" ] && [ -n "$ipv6_gateway" ] && ! { [ "$ipv6_addr" = "$(get_first_ipv6_addr)" ] || [ "$ipv6_gateway" = "$(get_first_ipv6_gateway)" ]; }; then echo "IPv6 netmask/gateway obtained from SLAAC/DHCPv6 is different from old system." dhcpv6_or_slaac=false