[client, android] Do not propagate empty routes (#3805)

If we get domain routes the Network prefix variable in route structure will be invalid (engine.go:1057). When we handower to Android the routes, we must to filter out the domain routes. If we do not do it the Android code will get "invalid prefix" string as a route.
This commit is contained in:
Zoltan Papp 2025-05-13 15:21:06 +02:00 committed by GitHub
parent efb0edfc4c
commit ee1cec47b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,10 @@ func (n *Notifier) SetListener(listener listener.NetworkChangeListener) {
func (n *Notifier) SetInitialClientRoutes(clientRoutes []*route.Route) {
nets := make([]string, 0)
for _, r := range clientRoutes {
// filter out domain routes
if r.IsDynamic() {
continue
}
nets = append(nets, r.Network.String())
}
sort.Strings(nets)