|
|
@ -3036,7 +3036,7 @@ func (b *LocalBackend) authReconfig() {
|
|
|
|
rcfg := b.routerConfig(cfg, prefs, oneCGNATRoute)
|
|
|
|
rcfg := b.routerConfig(cfg, prefs, oneCGNATRoute)
|
|
|
|
dcfg := dnsConfigForNetmap(nm, prefs, b.logf, version.OS())
|
|
|
|
dcfg := dnsConfigForNetmap(nm, prefs, b.logf, version.OS())
|
|
|
|
|
|
|
|
|
|
|
|
err = b.e.Reconfig(cfg, rcfg, dcfg, nm.Debug)
|
|
|
|
err = b.e.Reconfig(cfg, rcfg, dcfg)
|
|
|
|
if err == wgengine.ErrNoChanges {
|
|
|
|
if err == wgengine.ErrNoChanges {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3052,16 +3052,6 @@ func (b *LocalBackend) authReconfig() {
|
|
|
|
// a runtime.GOOS.
|
|
|
|
// a runtime.GOOS.
|
|
|
|
func shouldUseOneCGNATRoute(nm *netmap.NetworkMap, logf logger.Logf, versionOS string) bool {
|
|
|
|
func shouldUseOneCGNATRoute(nm *netmap.NetworkMap, logf logger.Logf, versionOS string) bool {
|
|
|
|
// Explicit enabling or disabling always take precedence.
|
|
|
|
// Explicit enabling or disabling always take precedence.
|
|
|
|
|
|
|
|
|
|
|
|
// Old way from control plane, pre capver 71:
|
|
|
|
|
|
|
|
// TODO(bradfitz): delete this path, once the control server starts
|
|
|
|
|
|
|
|
// sending it in nodeAttr.
|
|
|
|
|
|
|
|
if nm.Debug != nil {
|
|
|
|
|
|
|
|
if v, ok := nm.Debug.OneCGNATRoute.Get(); ok {
|
|
|
|
|
|
|
|
logf("[v1] shouldUseOneCGNATRoute: explicit=%v", v)
|
|
|
|
|
|
|
|
return v
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if v, ok := controlclient.ControlOneCGNATSetting().Get(); ok {
|
|
|
|
if v, ok := controlclient.ControlOneCGNATSetting().Get(); ok {
|
|
|
|
logf("[v1] shouldUseOneCGNATRoute: explicit=%v", v)
|
|
|
|
logf("[v1] shouldUseOneCGNATRoute: explicit=%v", v)
|
|
|
|
return v
|
|
|
|
return v
|
|
|
@ -3663,7 +3653,7 @@ func (b *LocalBackend) enterStateLockedOnEntry(newState ipn.State) {
|
|
|
|
b.blockEngineUpdates(true)
|
|
|
|
b.blockEngineUpdates(true)
|
|
|
|
fallthrough
|
|
|
|
fallthrough
|
|
|
|
case ipn.Stopped:
|
|
|
|
case ipn.Stopped:
|
|
|
|
err := b.e.Reconfig(&wgcfg.Config{}, &router.Config{}, &dns.Config{}, nil)
|
|
|
|
err := b.e.Reconfig(&wgcfg.Config{}, &router.Config{}, &dns.Config{})
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
b.logf("Reconfig(down): %v", err)
|
|
|
|
b.logf("Reconfig(down): %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3805,7 +3795,7 @@ func (b *LocalBackend) stateMachine() {
|
|
|
|
// a status update that predates the "I've shut down" update.
|
|
|
|
// a status update that predates the "I've shut down" update.
|
|
|
|
func (b *LocalBackend) stopEngineAndWait() {
|
|
|
|
func (b *LocalBackend) stopEngineAndWait() {
|
|
|
|
b.logf("stopEngineAndWait...")
|
|
|
|
b.logf("stopEngineAndWait...")
|
|
|
|
b.e.Reconfig(&wgcfg.Config{}, &router.Config{}, &dns.Config{}, nil)
|
|
|
|
b.e.Reconfig(&wgcfg.Config{}, &router.Config{}, &dns.Config{})
|
|
|
|
b.requestEngineStatusAndWait()
|
|
|
|
b.requestEngineStatusAndWait()
|
|
|
|
b.logf("stopEngineAndWait: done.")
|
|
|
|
b.logf("stopEngineAndWait: done.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|