Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,27 @@ func (conf *Config) IntersectsWith(other *Config) bool {
return false
}

func (conf *Config) Is6() bool {
for _, address := range conf.Interface.Addresses {
if address.Addr().Is6() {
return true
}
}
for _, dns := range conf.Interface.DNS {
if dns.Is6() {
return true
}
}
for _, peer := range conf.Peers {
for _, allowedip := range peer.AllowedIPs {
if allowedip.Addr().Is6() {
return true
}
}
}
return false
}

func (e *Endpoint) String() string {
if strings.IndexByte(e.Host, ':') != -1 {
return fmt.Sprintf("[%s]:%d", e.Host, e.Port)
Expand Down
2 changes: 1 addition & 1 deletion tunnel/interfacewatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (iw *interfaceWatcher) Configure(adapter *driver.Adapter, conf *conf.Config

iw.adapter, iw.conf, iw.luid = adapter, conf, luid
for _, event := range iw.storedEvents {
if event.luid == luid {
if event.luid == luid && (event.family != windows.AF_INET6 || conf.Is6()) {
iw.setup(event.family)
}
}
Expand Down