check error in correct place

This commit is contained in:
Callan Bryant 2020-03-04 22:04:13 +00:00
parent f00e344a72
commit 1572a78d6c
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

8
up.go
View File

@ -42,6 +42,10 @@ func CreateLink(conf *DsnetConfig) {
// bring up interface (UNKNOWN state instead of UP, a wireguard quirk)
err = netlink.LinkSetUp(link)
if err != nil {
ExitFail("Could not bring up device '%s' (%v)", conf.InterfaceName, err)
}
}
func ConfigureDevice(conf *DsnetConfig) {
@ -61,8 +65,4 @@ func ConfigureDevice(conf *DsnetConfig) {
if err != nil {
ExitFail("Could not configure device '%s' (%v)", conf.InterfaceName, err)
}
if err != nil {
ExitFail("Could not bring up device '%s' (%v)", conf.InterfaceName, err)
}
}