mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-15 18:05:49 +00:00
uip: finish off the changes for connect()
A connect that fails is now echoed back to the guest with a valid RST frame so that the client user sees "connection refused" not a long timeout and failure.
This commit is contained in:
committed by
Dimitri John Ledkov
parent
fccb7a1553
commit
77f6ea83ae
+3
-2
@@ -161,8 +161,9 @@ static struct uip_tcp_socket *uip_tcp_socket_alloc(struct uip_tx_arg *arg, u32 s
|
||||
|
||||
ret = connect(sk->fd, (struct sockaddr *)&sk->addr, sizeof(sk->addr));
|
||||
if (ret) {
|
||||
perror("connect");
|
||||
uip_tcp_payload_send(sk, UIP_TCP_FLAG_RST, 0);
|
||||
sk->ack_server = ntohl(tcp->seq) + 1;
|
||||
sk->seq_server = 0;
|
||||
uip_tcp_payload_send(sk, UIP_TCP_FLAG_RST|UIP_TCP_FLAG_ACK, 0);
|
||||
free(sk);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user