Skip to content

Commit 69648ad

Browse files
committed
adding interface validation
1 parent efc8134 commit 69648ad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/runner/validate.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package runner
33
import (
44
"errors"
55
"flag"
6+
"fmt"
7+
"net"
68

79
"github.com/projectdiscovery/gologger"
810
)
@@ -41,6 +43,12 @@ func (options *Options) validateOptions() error {
4143
options.Retries = DefaultRetriesConnectScan
4244
}
4345

46+
if options.Interface != "" {
47+
if _, err := net.InterfaceByName(options.Interface); err != nil {
48+
return fmt.Errorf("Interface %s not found", options.Interface)
49+
}
50+
}
51+
4452
return nil
4553
}
4654

0 commit comments

Comments
 (0)