Opened 6 years ago

Closed 6 years 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:
Platform: All

Description

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

Expected:

yay

Got:

getsockname: Socket is not connected

Attachments (1)

sock.c (383 bytes ) - added by leorize 6 years ago.

Download all attachments as: .zip

Change History (5)

by leorize, 6 years ago

Attachment: sock.c added

comment:1 by leorize, 6 years ago

patch: 01

comment:2 by leorize, 6 years ago

patch: 10

comment:4 by waddlesplash, 6 years ago

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