fix parseUnsafeRoutes for yaml.v3 (#1371)

We switched to yaml.v3 with #1148, but missed this spot that was still
casting into `map[any]any` when yaml.v3 makes it `map[string]any`. Also
clean up a few more `interface{}` that were added as we changed them all
to `any` with #1148.
This commit is contained in:
Wade Simmons
2025-04-01 09:49:26 -04:00
committed by GitHub
parent 879852c32a
commit 36bc9dd261
2 changed files with 18 additions and 18 deletions

View File

@@ -215,10 +215,10 @@ func parseUnsafeRoutes(c *config.C, networks []netip.Prefix) ([]Route, error) {
gateways = routing.Gateways{routing.NewGateway(viaIp, 1)}
case []interface{}:
case []any:
gateways = make(routing.Gateways, len(via))
for ig, v := range via {
gatewayMap, ok := v.(map[interface{}]interface{})
gatewayMap, ok := v.(map[string]any)
if !ok {
return nil, fmt.Errorf("entry %v in tun.unsafe_routes[%v].via is invalid", i+1, ig+1)
}