[PATCH 1/1] rpdfs-progs: Insert peer socket during net_connect()

Chris Kirby <[email protected]> Tue, 24 Mar 2026 11:11:02 -0500
Newsgroups dev.linux.lists.rpdfs-devel
Message-ID <971ef8bb3d8acc209b233eb47636c75afd4e3651.1774368557.git.ckirby@versity.com>
Attempts to send following a successful net_connect() were
failing because the peer socket was missing from the global
table.

Signed-off-by: Chris Kirby <[email protected]>
---
 utask/net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utask/net.c b/utask/net.c
index 7f21e4c..5935097 100644
--- a/utask/net.c
+++ b/utask/net.c
@@ -596,6 +596,7 @@ int net_connect(struct sockaddr_in *addr)
 {
 	struct net_instance *inst = &global_net_inst;
 	struct net_socket *sock;
+	struct net_socket *found;
 	int fd = -1;
 	int ret;
 
@@ -619,6 +620,9 @@ int net_connect(struct sockaddr_in *addr)
 	sock->fd = fd;
 	fd = -1;
 
+	found = get_peer_sock(inst, addr, sock);
+	BUG_ON(found != sock); /* XXX don't yet support racing reconnect */
+
 	ret = utask_create(send_utask, sock, &sock->send_tsk) ?:
 	      utask_create(recv_utask, sock, &sock->recv_tsk);
 	if (ret < 0)
-- 
2.53.0