Skip to content

Some sockets are never disassociated from the network interface #2590

@stevenengler

Description

@stevenengler

When a socket's peer address is set or changes after the socket has been associated with a network interface, that socket will never be disassociated from the network interface, which will cause the socket to stay in memory and won't make the socket's port available for other sockets.

For example:

  1. socket() - the application creates a new UDP socket
  2. bind() - the application binds the socket to some address; the socket is associated with the network interface using the key: <ip>:<port>|0:0
  3. connect() - the application sets the peer address of the socket
  4. close() - the socket is closed; the socket is disassociated from the network interface using the key <ip>:<port>|<peer_ip>:<peer_port>, but this key doesn't exist so the disassociation silently fails
  5. the socket remains associated with this interface until the end of the simulation

I think this is also an issue for client TCP sockets that are manually bound (bind() called before connect()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions