mirror of
https://github.com/clearml/dropbear
synced 2025-04-27 17:31:16 +00:00
Don't try to send data on first ack packet of 3way handshake.
Cisco SSH on 15.4(3)M2 or similar can't handle it.
This commit is contained in:
parent
c7bd5ac77d
commit
0ac33d22f7
21
netio.c
21
netio.c
@ -21,23 +21,6 @@ struct dropbear_progress_connection {
|
|||||||
char* errstring;
|
char* errstring;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__linux__) && defined(TCP_DEFER_ACCEPT)
|
|
||||||
static void set_piggyback_ack(int sock) {
|
|
||||||
/* Undocumented Linux feature - set TCP_DEFER_ACCEPT and data will be piggybacked
|
|
||||||
on the 3rd packet (ack) of the TCP handshake. Saves a IP packet.
|
|
||||||
http://thread.gmane.org/gmane.linux.network/224627/focus=224727
|
|
||||||
"Piggyback the final ACK of the three way TCP connection establishment with the data" */
|
|
||||||
int val = 1;
|
|
||||||
/* No error checking, this is opportunistic */
|
|
||||||
int err = setsockopt(sock, IPPROTO_TCP, TCP_DEFER_ACCEPT, (void*)&val, sizeof(val));
|
|
||||||
if (err)
|
|
||||||
{
|
|
||||||
TRACE(("Failed setsockopt TCP_DEFER_ACCEPT: %s", strerror(errno)))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Deallocate a progress connection. Removes from the pending list if iter!=NULL.
|
/* Deallocate a progress connection. Removes from the pending list if iter!=NULL.
|
||||||
Does not close sockets */
|
Does not close sockets */
|
||||||
static void remove_connect(struct dropbear_progress_connection *c, m_list_elem *iter) {
|
static void remove_connect(struct dropbear_progress_connection *c, m_list_elem *iter) {
|
||||||
@ -87,10 +70,6 @@ static void connect_try_next(struct dropbear_progress_connection *c) {
|
|||||||
set_sock_nodelay(c->sock);
|
set_sock_nodelay(c->sock);
|
||||||
setnonblocking(c->sock);
|
setnonblocking(c->sock);
|
||||||
|
|
||||||
#if defined(__linux__) && defined(TCP_DEFER_ACCEPT)
|
|
||||||
set_piggyback_ack(c->sock);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DROPBEAR_CLIENT_TCP_FAST_OPEN
|
#ifdef DROPBEAR_CLIENT_TCP_FAST_OPEN
|
||||||
fastopen = (c->writequeue != NULL);
|
fastopen = (c->writequeue != NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user