Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect code logic in fake_ip() #13

Open
flaviu2001 opened this issue Aug 4, 2021 · 0 comments
Open

Incorrect code logic in fake_ip() #13

flaviu2001 opened this issue Aug 4, 2021 · 0 comments

Comments

@flaviu2001
Copy link

in the function below you check if rand[0] equals skip and in that case you wish to retry the entire function. If you need that you have to do return fake_ip(), otherwise the function will simply continue with the bad value.

def fake_ip():
	skip = '127'
	rand = range(4)
	for x in range(4):
		rand[x] = randrange(0,256)
	if rand[0] == skip:
		fake_ip()  #here you have  to put the return
	fkip = '%d.%d.%d.%d' % (rand[0],rand[1],rand[2],rand[3])
	return fkip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant