mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
26c532316a
commit
7b4fc3d31d
2 changed files with 32 additions and 1 deletions
|
@ -131,7 +131,9 @@ func (mod *ZeroGod) startAdvertiser(fileName string) error {
|
|||
for _, svc := range advertiser.Services {
|
||||
// if no external responder has been specified, check if port is available
|
||||
if svc.Responder == "" {
|
||||
// if the port was not set or is not available or is requesdted by another service
|
||||
for svc.Port == 0 || !isPortAvailable(svc.Port) || isPortRequested(svc, services) {
|
||||
// set a new one and try again
|
||||
newPort := (rand.Intn(65535-1024) + 1024)
|
||||
mod.Warning("port %d for service %s is not avaialble, trying %d ...",
|
||||
svc.Port,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue