Error if neither -iface or -name is specified
This prevents a nil pointer dereference if (e.g.) weaver is invoked with no arguments. Signed-off-by: Alex Bligh <alex@alex.org.uk>
This commit is contained in:
1 parent
c13980af4b
commit
24bd7151e2
1 file changed
+3
@@ -92,6 +92,9 @@ func main() {
|
||||
}
|
||||
|
||||
if routerName == "" {
|
||||
if iface == nil {
|
||||
log.Fatal("Either an interface must be specified with -iface or a name with -name")
|
||||
}
|
||||
routerName = iface.HardwareAddr.String()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user