[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251021195906.20389-1-adelodunolaoluwa@yahoo.com>
Date: Tue, 21 Oct 2025 20:59:06 +0100
From: Sunday Adelodun <adelodunolaoluwa@...oo.com>
To: kuniyu@...gle.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
horms@...nel.org
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
david.hunter.linux@...il.com,
Sunday Adelodun <adelodunolaoluwa@...oo.com>
Subject: [PATCH v2] net: unix: remove outdated BSD behavior comment in unix_release_sock()
Remove the long-standing comment in unix_release_sock() that described a
behavioral difference between Linux and BSD regarding when ECONNRESET is
sent to connected UNIX sockets upon closure.
As confirmed by testing on macOS (similar to BSD behavior), ECONNRESET
is only observed for SOCK_DGRAM sockets, not for SOCK_STREAM. Meanwhile,
Linux already returns ECONNRESET in cases where a socket is closed with
unread data or is not yet accept()ed. This means the previous comment no
longer accurately describes current behavior and is misleading.
Suggested-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Signed-off-by: Sunday Adelodun <adelodunolaoluwa@...oo.com>
---
Changelog:
Changes since v1:
- Remove the entire outdated BSD behavior comment, per review feedback.
- Update commit message to reflect testing results and reviewer input.
net/unix/af_unix.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 768098dec231..54177caa9c12 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -733,17 +733,6 @@ static void unix_release_sock(struct sock *sk, int embrion)
/* ---- Socket is dead now and most probably destroyed ---- */
- /*
- * Fixme: BSD difference: In BSD all sockets connected to us get
- * ECONNRESET and we die on the spot. In Linux we behave
- * like files and pipes do and wait for the last
- * dereference.
- *
- * Can't we simply set sock->err?
- *
- * What the above comment does talk about? --ANK(980817)
- */
-
if (READ_ONCE(unix_tot_inflight))
unix_gc(); /* Garbage collect fds */
}
--
2.43.0
Powered by blists - more mailing lists