Skip to content

UDP factory can assign the same port to multiple devices #175

Description

@VastBlast

When multiple GotaTun devices start with port 0, their UDP sockets use SO_REUSEADDR. The OS can then assign the same ephemeral port to more than one device. Incoming packets go to one socket, leaving the other device running but unable to receive replies.

I reproduced this on Linux with pools of 200 sockets: duplicate ports appeared in 50 out of 100 runs, and packets for a shared port all went to the socket bound last.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions