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

Contiki random port is not random #354

Open
mtusnio opened this issue Mar 23, 2017 · 0 comments
Open

Contiki random port is not random #354

mtusnio opened this issue Mar 23, 2017 · 0 comments
Labels

Comments

@mtusnio
Copy link
Contributor

mtusnio commented Mar 23, 2017

The rand() call after srand(time(NULL)) always results in 0, which means that the static API always binds itself to the port 6000. Removing the srand causes the port 18585 to be always used, so in the end I can think of 2 options:

a) assume that the application has to srand with a seed and move the responsibility to the application
b) abstract the call for srand and implement seeding on every platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants