Skip to content

Commit

Permalink
ip filter point to point interface
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 9, 2021
1 parent a10fa62 commit f0777ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/netx/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func InternalIp() string {
}

for _, inf := range infs {
if isEthDown(inf.Flags) || isLoopback(inf.Flags) {
if isEthDown(inf.Flags) || isLoopback(inf.Flags) || isPointToPoint(inf.Flags) {
continue
}

Expand Down Expand Up @@ -39,3 +39,7 @@ func isEthDown(f net.Flags) bool {
func isLoopback(f net.Flags) bool {
return f&net.FlagLoopback == net.FlagLoopback
}

func isPointToPoint(f net.Flags) bool {
return f&net.FlagPointToPoint == net.FlagLoopback
}

0 comments on commit f0777ca

Please sign in to comment.