fe80:0:0:0:226:4aff:fe0d:592e是您的ipv6地址;-)。
使用此检查
if (current_addr instanceof Inet4Address) System.out.println(current_addr.getHostAddress());else if (current_addr instanceof Inet6Address) System.out.println(current_addr.getHostAddress());
如果您只关心IPv4,则只需丢弃IPv6情况。但是请注意,IPv6是未来的^^。
PS:检查您
break的某些s是否应该是
continues。



