#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:
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 22 months ago.

Download all attachments as: .zip

Change History (5)

by leorize, 22 months ago

Attachment: sock.c added

comment:1 by leorize, 22 months ago

patch: 01

comment:2 by leorize, 22 months ago

patch: 10

comment:4 by waddlesplash, 20 months ago

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