The conn_sock_drain() call is only there to force the system to ACK
pending data in case of TCP_QUICKACK so that the client doesn't retransmit,
otherwise it leads to a real RST making the feature useless. There's no
point in draining the connection when quick ack cannot be disabled, so
let's move the call inside the ifdef part.
if (!conn_ctrl_ready(conn))
goto out;
- conn_sock_drain(conn);
#ifdef TCP_QUICKACK
+ /* drain is needed only to send the quick ACK */
+ conn_sock_drain(conn);
+
/* re-enable quickack if it was disabled to ack all data and avoid
* retransmits from the client that might trigger a real reset.
*/