Skip to content

Commit

Permalink
Filter interfaces that are up (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-soltesz authored Jun 30, 2023
1 parent 4d21ab4 commit 240575e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ func processFlags() ([]net.Interface, error) {
if err != nil {
return ifaces, err
}
ifaces = append(ifaces, *i)
if i.Flags&net.FlagUp != 0 {
// We can only capture packets from interfaces that are up.
ifaces = append(ifaces, *i)
}
}
return ifaces, nil
}
Expand Down

0 comments on commit 240575e

Please sign in to comment.