Skip to content

Commit

Permalink
feat: #31 ignore docker network interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Aug 9, 2024
1 parent 40a0bca commit cbe7a08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/pkg/networks/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package networks

import (
"net"
"strings"
)

type IP struct {
Expand All @@ -26,7 +27,8 @@ func List() ([]Network, error) {
isLoopback := i.Flags&net.FlagLoopback == net.FlagLoopback
isDown := i.Flags&net.FlagUp == 0
isNotBroadcast := i.Flags&net.FlagBroadcast == 0
if isLoopback || isDown || isNotBroadcast {
isDockerNetwork := strings.Contains(i.Name, "docker")
if isLoopback || isDown || isNotBroadcast || isDockerNetwork {
continue
}

Expand Down

0 comments on commit cbe7a08

Please sign in to comment.