Page MenuHomeFreeBSD

Let listen() return EDESTADDRREQ when not bound.
ClosedPublic

Authored by ed on Jul 9 2015, 12:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 20, 1:49 AM
Unknown Object (File)
Thu, Jul 17, 11:34 AM
Unknown Object (File)
Jun 25 2025, 7:38 PM
Unknown Object (File)
Jun 23 2025, 11:27 PM
Unknown Object (File)
Jun 23 2025, 3:38 PM
Unknown Object (File)
Jun 22 2025, 11:19 AM
Unknown Object (File)
Jun 19 2025, 3:22 AM
Unknown Object (File)
Jun 18 2025, 8:13 PM
Subscribers

Details

Summary

We currently return EINVAL when calling listen() on a UNIX socket that has not been bound to a pathname. If my interpretation of POSIX is correct, we should return EDESTADDRREQ: "The socket is not bound to a local address, and the protocol does not support listening on an unbound socket."

Return EDESTADDRREQ instead when not bound and not connected.

Test Plan

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Let listen() return EDESTADDREQ when not bound..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: glebius, kib.
ed set the repository for this revision to rS FreeBSD src repository - subversion.
kib added a reviewer: network.
kib removed a reviewer: kib.
ed retitled this revision from Let listen() return EDESTADDREQ when not bound. to Let listen() return EDESTADDRREQ when not bound..Jul 9 2015, 1:00 PM
ed updated this object.
ed added a reviewer: kib.
gnn added a reviewer: gnn.
gnn added a subscriber: gnn.

I don't know about POSIX but I do think that this is a good idea and a better error to return in this case.

This revision is now accepted and ready to land.Jul 9 2015, 1:07 PM
In D3038#59923, @gnn wrote:

I don't know about POSIX but I do think that this is a good idea and a better error to return in this case.

Perfect! Thanks for the quick review! I'll leave this code review open for another day. Will push it in if no one else objects.

This revision was automatically updated to reflect the committed changes.