Opened 10 months ago

Closed 8 months ago

#14312 closed bug (fixed)

getsockname(2) doesn't work if socket isn't connected

Reported by: leorize Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Network & Internet/Stack Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


According to POSIX, getsockname is meant to "retrieve the locally-bound name of the specified socket", so it shouldn't fail if the socket is not connected.

Attached below is a toy program that describe this issue

How to run:

$ gcc -o sock sock.c -lnetwork
$ ./sock




getsockname: Socket is not connected

Attachments (1)

sock.c (383 bytes) - added by leorize 10 months ago.

Download all attachments as: .zip

Change History (5)

Changed 10 months ago by leorize

Attachment: sock.c added

comment:1 Changed 10 months ago by leorize

Has a Patch: set

comment:2 Changed 10 months ago by leorize

Has a Patch: unset

comment:4 Changed 8 months ago by waddlesplash

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.