fixup! cmd/headscale/cli/utils: merge ip_prefix with ip_prefixes in config

This commit is contained in:
Csaba Sarkadi 2022-01-29 16:27:36 +01:00
parent 74f26d3685
commit 0a1db89d33

View File

@ -251,7 +251,8 @@ func getHeadscaleConfig() headscale.Config {
// dedup // dedup
normalizedPrefixes := make(map[string]int, len(parsedPrefixes)) normalizedPrefixes := make(map[string]int, len(parsedPrefixes))
for i, p := range parsedPrefixes { for i, p := range parsedPrefixes {
normalizedPrefixes[p.String()] = i normalized, _ := p.Range().Prefix()
normalizedPrefixes[normalized.String()] = i
} }
// convert back to list // convert back to list
@ -265,6 +266,8 @@ func getHeadscaleConfig() headscale.Config {
log.Warn().Msgf("'ip_prefixes' not configured, falling back to default: %v", prefixes) log.Warn().Msgf("'ip_prefixes' not configured, falling back to default: %v", prefixes)
} }
log.Warn().Msgf("==> %v", prefixes)
return headscale.Config{ return headscale.Config{
ServerURL: viper.GetString("server_url"), ServerURL: viper.GetString("server_url"),
Addr: viper.GetString("listen_addr"), Addr: viper.GetString("listen_addr"),