mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-06 18:06:38 +02:00
Make extra IPs from interfaces optional
This commit is contained in:
parent
62a20f5f1a
commit
f69dd6fb62
@ -89,11 +89,6 @@ func (m *localIPManager) UpdateLocalIPs(iface common.IFaceMapper) (err error) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
interfaces, err := net.Interfaces()
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("get interfaces: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
var newIPv4Bitmap [1 << 16]uint32
|
var newIPv4Bitmap [1 << 16]uint32
|
||||||
ipv4Set := make(map[string]struct{})
|
ipv4Set := make(map[string]struct{})
|
||||||
var ipv4Addresses []string
|
var ipv4Addresses []string
|
||||||
@ -104,8 +99,13 @@ func (m *localIPManager) UpdateLocalIPs(iface common.IFaceMapper) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, intf := range interfaces {
|
interfaces, err := net.Interfaces()
|
||||||
m.processInterface(intf, &newIPv4Bitmap, ipv4Set, &ipv4Addresses)
|
if err != nil {
|
||||||
|
log.Warnf("failed to get interfaces: %v", err)
|
||||||
|
} else {
|
||||||
|
for _, intf := range interfaces {
|
||||||
|
m.processInterface(intf, &newIPv4Bitmap, ipv4Set, &ipv4Addresses)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user