fix(connections): announce PtP links again (fixes #9730) (#9731)

This commit is contained in:
Jakob Borg
2024-09-23 14:32:19 +02:00
committed by GitHub
parent 3e501d9036
commit a8e2c8edb6
3 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -10,7 +10,9 @@ import (
"net"
)
func GetLans() ([]*net.IPNet, error) {
// GetInterfaceAddrs returns the IP networks of all interfaces that are up.
// Point-to-point interfaces are exluded unless includePtP is true.
func GetInterfaceAddrs(includePtP bool) ([]*net.IPNet, error) {
intfs, err := net.Interfaces()
if err != nil {
return nil, err
@@ -21,7 +23,7 @@ func GetLans() ([]*net.IPNet, error) {
if intf.Flags&net.FlagRunning == 0 {
continue
}
if intf.Flags&net.FlagPointToPoint != 0 {
if !includePtP && intf.Flags&net.FlagPointToPoint != 0 {
// Point-to-point interfaces are typically VPNs and similar
// which, for our purposes, do not qualify as LANs.
continue