diff options
Diffstat (limited to 'service/ifaceconfig.go')
-rw-r--r-- | service/ifaceconfig.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/service/ifaceconfig.go b/service/ifaceconfig.go index 6f2320cf..e12a1b41 100644 --- a/service/ifaceconfig.go +++ b/service/ifaceconfig.go @@ -275,9 +275,15 @@ func enableFirewall(conf *conf.Config, tun *tun.NativeTun) error { } restrictDNS := len(conf.Interface.Dns) > 0 restrictAll := false - for _, peer := range conf.Peers { - for _, allowedip := range peer.AllowedIPs { + if len(conf.Peers) == 1 { + nextallowedip: + for _, allowedip := range conf.Peers[0].AllowedIPs { if allowedip.Cidr == 0 { + for _, b := range allowedip.IP { + if b != 0 { + continue nextallowedip + } + } restrictAll = true break } |