Skip to content

Commit

Permalink
Update ipv6.go
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS authored Nov 8, 2024
1 parent 2db438f commit cc8cbfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipv6/ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func getIPv6PrefixLength(interfaceName string) (string, error) {
return "", err
}
// 匹配 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)
if len(matches) == 0 {
return "", nil
Expand Down

0 comments on commit cc8cbfc

Please sign in to comment.