498
515
matches := filterAndCollateAddressIndexes(numAddr, getAddrFunc, matchFunc)
500
517
// Retrieve the indexes of the addresses with the best scope and type match.
518
allowedMatchTypes := []scopeMatch{exactScopeIPv4, exactScope, fallbackScopeIPv4, fallbackScope}
502
519
for _, matchType := range allowedMatchTypes {
503
520
indexes, ok := matches[matchType]
504
521
if ok && len(indexes) > 0 {