Skip to content

Contiki random port is not random #354

@mtusnio

Description

@mtusnio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions