|
|
@ -440,14 +440,14 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine.
|
|
|
|
log.Printf("Connecting to BIRD at %s ...", args.birdSocketPath)
|
|
|
|
log.Printf("Connecting to BIRD at %s ...", args.birdSocketPath)
|
|
|
|
conf.BIRDClient, err = createBIRDClient(args.birdSocketPath)
|
|
|
|
conf.BIRDClient, err = createBIRDClient(args.birdSocketPath)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, false, err
|
|
|
|
return nil, false, fmt.Errorf("createBIRDClient: %w", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !useNetstack {
|
|
|
|
if !useNetstack {
|
|
|
|
dev, devName, err := tstun.New(logf, name)
|
|
|
|
dev, devName, err := tstun.New(logf, name)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
tstun.Diagnose(logf, name)
|
|
|
|
tstun.Diagnose(logf, name)
|
|
|
|
return nil, false, err
|
|
|
|
return nil, false, fmt.Errorf("tstun.New(%q): %w", name, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
conf.Tun = dev
|
|
|
|
conf.Tun = dev
|
|
|
|
if strings.HasPrefix(name, "tap:") {
|
|
|
|
if strings.HasPrefix(name, "tap:") {
|
|
|
@ -459,11 +459,11 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine.
|
|
|
|
r, err := router.New(logf, dev, linkMon)
|
|
|
|
r, err := router.New(logf, dev, linkMon)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
dev.Close()
|
|
|
|
dev.Close()
|
|
|
|
return nil, false, err
|
|
|
|
return nil, false, fmt.Errorf("creating router: %w", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d, err := dns.NewOSConfigurator(logf, devName)
|
|
|
|
d, err := dns.NewOSConfigurator(logf, devName)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, false, err
|
|
|
|
return nil, false, fmt.Errorf("dns.NewOSConfigurator: %w", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
conf.DNS = d
|
|
|
|
conf.DNS = d
|
|
|
|
conf.Router = r
|
|
|
|
conf.Router = r
|
|
|
|