mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-10 15:39:07 +02:00
Free the raw sockets when the loopback lookup fails
This commit is contained in:
@@ -76,6 +76,9 @@ func (p *Proxy) Listen() error {
|
|||||||
|
|
||||||
loopback, err := net.InterfaceByName(loopbackDevice)
|
loopback, err := net.InterfaceByName(loopbackDevice)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if freeErr := p.Free(); freeErr != nil {
|
||||||
|
log.Errorf("failed to free the wgproxy: %s", freeErr)
|
||||||
|
}
|
||||||
return fmt.Errorf("look up %s: %w", loopbackDevice, err)
|
return fmt.Errorf("look up %s: %w", loopbackDevice, err)
|
||||||
}
|
}
|
||||||
p.loIndex = loopback.Index
|
p.loIndex = loopback.Index
|
||||||
|
|||||||
Reference in New Issue
Block a user