core: 修复判断动静态的逻辑错误

关联 #298
This commit is contained in:
bin456789
2025-03-28 13:26:28 +08:00
parent 3a460f9004
commit 06559947e3

View File

@@ -419,7 +419,7 @@ test_internet
# IP 不同的情况在前面已经改成静态了 # IP 不同的情况在前面已经改成静态了
if ! $ipv4_has_internet && if ! $ipv4_has_internet &&
$dhcpv4 && [ -n "$ipv4_addr" ] && [ -n "$ipv4_gateway" ] && $dhcpv4 && [ -n "$ipv4_addr" ] && [ -n "$ipv4_gateway" ] &&
! { [ "$ipv4_addr" = "$(get_first_ipv4_addr)" ] || [ "$ipv4_gateway" = "$(get_first_ipv4_gateway)" ]; }; then ! { [ "$ipv4_addr" = "$(get_first_ipv4_addr)" ] && [ "$ipv4_gateway" = "$(get_first_ipv4_gateway)" ]; }; then
echo "IPv4 netmask/gateway obtained from DHCP is different from old system." echo "IPv4 netmask/gateway obtained from DHCP is different from old system."
dhcpv4=false dhcpv4=false
flush_ipv4_config flush_ipv4_config
@@ -430,7 +430,7 @@ fi
if ! $ipv6_has_internet && if ! $ipv6_has_internet &&
{ $dhcpv6_or_slaac || $ra_has_gateway; } && { $dhcpv6_or_slaac || $ra_has_gateway; } &&
[ -n "$ipv6_addr" ] && [ -n "$ipv6_gateway" ] && [ -n "$ipv6_addr" ] && [ -n "$ipv6_gateway" ] &&
! { [ "$ipv6_addr" = "$(get_first_ipv6_addr)" ] || [ "$ipv6_gateway" = "$(get_first_ipv6_gateway)" ]; }; then ! { [ "$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." echo "IPv6 netmask/gateway obtained from SLAAC/DHCPv6 is different from old system."
dhcpv6_or_slaac=false dhcpv6_or_slaac=false
should_disable_accept_ra=true should_disable_accept_ra=true