mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-15 23:06:38 +00:00
extraInitialRoutes() was meant to preserve only the fake IP route (240.0.0.0/8) across TUN rebuilds, but it re-injected any initial route missing from the current set. When the management server advertised exit node routes (0.0.0.0/0) that were later filtered by the route selector, extraInitialRoutes() re-added them, causing the Android VPN to capture all traffic with no peer to handle it. Store the fake IP route explicitly and append only that in notify(), removing the overly broad initial route diffing.
41 lines
833 B
Go
41 lines
833 B
Go
//go:build !android && !ios
|
|
|
|
package notifier
|
|
|
|
import (
|
|
"net/netip"
|
|
|
|
"github.com/netbirdio/netbird/client/internal/listener"
|
|
"github.com/netbirdio/netbird/route"
|
|
)
|
|
|
|
type Notifier struct{}
|
|
|
|
func NewNotifier() *Notifier {
|
|
return &Notifier{}
|
|
}
|
|
|
|
func (n *Notifier) SetListener(listener listener.NetworkChangeListener) {
|
|
// Not used on non-mobile platforms
|
|
}
|
|
|
|
func (n *Notifier) SetInitialClientRoutes([]*route.Route, []*route.Route) {
|
|
// Not used on non-mobile platforms
|
|
}
|
|
|
|
func (n *Notifier) SetFakeIPRoute(*route.Route) {
|
|
// Not used on non-mobile platforms
|
|
}
|
|
|
|
func (n *Notifier) OnNewRoutes(idMap route.HAMap) {
|
|
// Not used on non-mobile platforms
|
|
}
|
|
|
|
func (n *Notifier) OnNewPrefixes(prefixes []netip.Prefix) {
|
|
// Not used on non-mobile platforms
|
|
}
|
|
|
|
func (n *Notifier) GetInitialRouteRanges() []string {
|
|
return []string{}
|
|
}
|