check config contains external IPv6/IPv4

This commit is contained in:
Callan Bryant 2020-10-26 18:11:56 +00:00
parent 965fc367ac
commit 608dbf176f
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

View File

@ -74,6 +74,10 @@ func MustLoadDsnetConfig() *DsnetConfig {
err = validator.New().Struct(conf) err = validator.New().Struct(conf)
check(err) check(err)
if len(conf.ExternalIP) == 0 && len(conf.ExternalIP6) == 0 {
ExitFail("Config does not contain ExternalIP or ExternalIP6")
}
return &conf return &conf
} }