Skip to content

Bug: _ep_to_sockaddr() does not update in6_addr->sin6_scope_id #19486

@mrdeep1

Description

@mrdeep1

Description

The _ep_to_sockaddr() function does not update IPv6's in6_addr->sin6_scope_id with ep->netif. If _sockaddr_to_ep() function is later used for the same sockaddr, then out->netif does get updated (unless sin6_scope_id == 0), potentially with rubbish.

Steps to reproduce the issue

MODULE += posix_sockets

Use the getsockname() or getpeername() functions and look at the sin6_scope_id returned in the struct sockaddr_in6 structure.

Expected results

sin6_scope_id contains the interface number, not some random values based on how the structure was initialized before the call.

ep_to_sockaddr() function does update IPv6's in6_addr->sin6_scope_id with ep->netif.

Actual results

in6_addr->sin6_scope_id ends up unchanged, possibly a random value, depending on how struct sockaddr *address has been initialized.

Versions

Latest master (812c216)

Metadata

Metadata

Assignees

Labels

Type: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions