ipn: rename SetRunExitNode to SetAdvertiseExitNode

From Maisem's code review feedback where he mashed the merge
button by mistake.

Change-Id: I55abce036a6c25dc391250514983125dda10126c
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2022-01-06 16:17:00 -08:00
parent 2cfc96aa90
commit e68d87eb44
2 changed files with 5 additions and 5 deletions

View File

@ -446,9 +446,9 @@ func (p *Prefs) AdvertisesExitNode() bool {
return v4 && v6
}
// SetRunExitNode mutates p (if non-nil) to add or remove the two
// SetAdvertiseExitNode mutates p (if non-nil) to add or remove the two
// /0 exit node routes.
func (p *Prefs) SetRunExitNode(runExit bool) {
func (p *Prefs) SetAdvertiseExitNode(runExit bool) {
if p == nil {
return
}

View File

@ -659,18 +659,18 @@ func TestPrefsExitNode(t *testing.T) {
p.AdvertiseRoutes = []netaddr.IPPrefix{
netaddr.MustParseIPPrefix("10.0.0.0/16"),
}
p.SetRunExitNode(true)
p.SetAdvertiseExitNode(true)
if got, want := len(p.AdvertiseRoutes), 3; got != want {
t.Errorf("routes = %d; want %d", got, want)
}
p.SetRunExitNode(true)
p.SetAdvertiseExitNode(true)
if got, want := len(p.AdvertiseRoutes), 3; got != want {
t.Errorf("routes = %d; want %d", got, want)
}
if !p.AdvertisesExitNode() {
t.Errorf("not advertising after enable")
}
p.SetRunExitNode(false)
p.SetAdvertiseExitNode(false)
if p.AdvertisesExitNode() {
t.Errorf("advertising after disable")
}