wgengine: fail NewUserspaceEngine if wireguard device doesn't come up

Just something I ran across while debugging an unrelated failure. This
is not in response to any bug/issue.

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali 2021-10-18 13:09:51 -04:00 committed by Maisem Ali
parent 59a906df47
commit 85fa1b0d61

View File

@ -388,7 +388,9 @@ func NewUserspaceEngine(logf logger.Logf, conf Config) (_ Engine, reterr error)
}() }()
e.logf("Bringing wireguard device up...") e.logf("Bringing wireguard device up...")
e.wgdev.Up() if err := e.wgdev.Up(); err != nil {
return nil, fmt.Errorf("wgdev.Up(): %w", err)
}
e.logf("Bringing router up...") e.logf("Bringing router up...")
if err := e.router.Up(); err != nil { if err := e.router.Up(); err != nil {
return nil, err return nil, err