Skip to contentSkip to conversation

rpdfs-progs: Insert peer socket during net_connect()

PATCH Applied Chris Kirby 2 participants 2 messages Mar 24 – Mar 25

lore
Share & tools
lore
#0 lore raw

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

Attempts to send following a successful net_connect() were failing because the peer socket was missing from the global table.

---
 utask/net.c | 4 ++++
 1 file changed, 4 insertions(+)
utask/net.c +4 -0
index 7f21e4c..5935097 100644
@@ -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)
Signature · 1 line
2.53.0
Applied
#1 lore raw
Quoted 3 lines · Chris Kirby

Attempts to send following a successful net_connect() were failing because the peer socket was missing from the global table.

Applied, thanks!

- z