mirror of
https://github.com/tailscale/tailscale.git
synced 2025-09-21 05:31:36 +02:00
ipn/ipnlocal: remove the pointer from appc.RouteInfo
Change-Id: I77ddb19619f45d93ffbf2f8981d59506e347706b
This commit is contained in:
parent
9e4c16292a
commit
aeeb434576
@ -651,9 +651,7 @@ func (b *LocalBackend) consumeEventbusTopics() {
|
||||
// Whether or not routes should be stored can change over time.
|
||||
shouldStoreRoutes := b.ControlKnobs().AppCStoreRoutes.Load()
|
||||
if shouldStoreRoutes {
|
||||
// TODO(creachdadair, 2025-09-13): This is a pointer for historical
|
||||
// reasons, which should go away along with the callback.
|
||||
if err := b.storeRouteInfo(&ri); err != nil {
|
||||
if err := b.storeRouteInfo(ri); err != nil {
|
||||
b.logf("appc: failed to store route info: %v", err)
|
||||
}
|
||||
}
|
||||
@ -7414,7 +7412,7 @@ func namespaceKeyForCurrentProfile(pm *profileManager, key ipn.StateKey) ipn.Sta
|
||||
|
||||
const routeInfoStateStoreKey ipn.StateKey = "_routeInfo"
|
||||
|
||||
func (b *LocalBackend) storeRouteInfo(ri *appc.RouteInfo) error {
|
||||
func (b *LocalBackend) storeRouteInfo(ri appc.RouteInfo) error {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
if b.pm.CurrentProfile().ID() == "" {
|
||||
|
@ -2534,7 +2534,7 @@ func TestBackfillAppConnectorRoutes(t *testing.T) {
|
||||
|
||||
// Store the test IP in profile data, but not in Prefs.AdvertiseRoutes.
|
||||
b.ControlKnobs().AppCStoreRoutes.Store(true)
|
||||
if err := b.storeRouteInfo(&appc.RouteInfo{
|
||||
if err := b.storeRouteInfo(appc.RouteInfo{
|
||||
Domains: map[string][]netip.Addr{
|
||||
"example.com": {ip},
|
||||
},
|
||||
@ -5485,10 +5485,10 @@ func TestReadWriteRouteInfo(t *testing.T) {
|
||||
b.pm.currentProfile = prof1.View()
|
||||
|
||||
// set up routeInfo
|
||||
ri1 := &appc.RouteInfo{}
|
||||
ri1 := appc.RouteInfo{}
|
||||
ri1.Wildcards = []string{"1"}
|
||||
|
||||
ri2 := &appc.RouteInfo{}
|
||||
ri2 := appc.RouteInfo{}
|
||||
ri2.Wildcards = []string{"2"}
|
||||
|
||||
// read before write
|
||||
|
Loading…
x
Reference in New Issue
Block a user