mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-26 03:25:35 +00:00
cmd/tailscale: fix setting revert checker's finding an exit node
It was using the wrong prefs (intended vs current) to map the current exit node ID to an IP. Fixes #3480 Change-Id: I9f117d99a84edddb4cd1cb0df44a2f486abde6c2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
03a323de4e
commit
003089820d
@ -408,6 +408,21 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
|
|||||||
},
|
},
|
||||||
want: accidentalUpPrefix + " --hostname=foo --exit-node=100.64.5.7",
|
want: accidentalUpPrefix + " --hostname=foo --exit-node=100.64.5.7",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "error_exit_node_and_allow_lan_omit_with_id_pref", // Isue 3480
|
||||||
|
flags: []string{"--hostname=foo"},
|
||||||
|
curExitNodeIP: netaddr.MustParseIP("100.2.3.4"),
|
||||||
|
curPrefs: &ipn.Prefs{
|
||||||
|
ControlURL: ipn.DefaultControlURL,
|
||||||
|
AllowSingleHosts: true,
|
||||||
|
CorpDNS: true,
|
||||||
|
NetfilterMode: preftype.NetfilterOn,
|
||||||
|
|
||||||
|
ExitNodeAllowLANAccess: true,
|
||||||
|
ExitNodeID: "some_stable_id",
|
||||||
|
},
|
||||||
|
want: accidentalUpPrefix + " --hostname=foo --exit-node-allow-lan-access --exit-node=100.2.3.4",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "ignore_login_server_synonym",
|
name: "ignore_login_server_synonym",
|
||||||
flags: []string{"--login-server=https://controlplane.tailscale.com"},
|
flags: []string{"--login-server=https://controlplane.tailscale.com"},
|
||||||
|
@ -447,7 +447,7 @@ func runUp(ctx context.Context, args []string) error {
|
|||||||
flagSet: upFlagSet,
|
flagSet: upFlagSet,
|
||||||
upArgs: upArgs,
|
upArgs: upArgs,
|
||||||
backendState: st.BackendState,
|
backendState: st.BackendState,
|
||||||
curExitNodeIP: exitNodeIP(prefs, st),
|
curExitNodeIP: exitNodeIP(curPrefs, st),
|
||||||
}
|
}
|
||||||
simpleUp, justEditMP, err := updatePrefs(prefs, curPrefs, env)
|
simpleUp, justEditMP, err := updatePrefs(prefs, curPrefs, env)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user