mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-14 12:54:54 +08:00
Update ipv6.go
This commit is contained in:
@@ -87,7 +87,7 @@ func getIPv6PrefixLength(interfaceName string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
// 匹配 inet6 地址和前缀长度
|
// 匹配 inet6 地址和前缀长度
|
||||||
re := regexp.MustCompile(`\s*inet6\s+([a-fA-F0-9:]+)/(\d+)\s+`)
|
re := regexp.MustCompile(`\s*inet6\s+([a-fA-F0-9:]+)/(\d+)\s+scope\s+global`)
|
||||||
matches := re.FindAllStringSubmatch(string(output), -1)
|
matches := re.FindAllStringSubmatch(string(output), -1)
|
||||||
if len(matches) == 0 {
|
if len(matches) == 0 {
|
||||||
return "", nil
|
return "", nil
|
||||||
|
Reference in New Issue
Block a user