Project

General

Profile

Actions

Bug #2965

closed

read(2), etc. return EAFNOSUPPORT after UDP disconnect

Added by cmusser over 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Networking
Target version:
-
Start date:
11/07/2016
Due date:
% Done:

0%

Estimated time:

Description

I ran into an unexpected return code from read(2)-like functions after unconnecting a connected UDP socket.

From what I've gleaned (from Stevens' "UNP", man pages, testing on other systems). unconnecting a connected UDP socket is done by passing a "null address" to connect(2). In response, it unconnects the socket and returns success (0) or EAFNOSUPPORT

On DragonFly, connect(2) returns success and unconnects the socket, but then the next read from the socket returns EAFNOSUPPORT. It seems as if EAFNOSUPPORT should come from `connect(2) instead. Neither read(2), recvfrom(2) or recvmsg(2) are documented as returning EAFNOSUPPORT.

I have a Github project at https://github.com/cmusser/udp_disconnect that demonstrates this behavior.

Actions

Also available in: Atom PDF