From 8185028aba7d8c2c2a0d034ead7e65ec2f152355 Mon Sep 17 00:00:00 2001 From: Matan Broner Date: Mon, 27 Mar 2023 18:15:26 +0000 Subject: [PATCH] no fast open in lib_convert connect --- lib_convert/convert_client.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib_convert/convert_client.c b/lib_convert/convert_client.c index d6e6461..08a5eca 100644 --- a/lib_convert/convert_client.c +++ b/lib_convert/convert_client.c @@ -236,9 +236,20 @@ _redirect(socket_state_t *state, struct sockaddr *dest) if (len < 0) return len; - // use TCP fast open to send the convert header in the SYN packet - return sendto(state->fd, buf, len, MSG_FASTOPEN, _converter_addr->ai_addr, - _converter_addr->ai_addrlen); + // // use TCP fast open to send the convert header in the SYN packet + // return sendto(state->fd, buf, len, MSG_FASTOPEN, _converter_addr->ai_addr, + // _converter_addr->ai_addrlen); + + // Fast Open interferes with creating subflows + int (*lconnect)(int, const struct sockaddr *, socklen_t) = dlsym(RTLD_NEXT, "connect"); + if (lconnect(state->fd, _converter_addr->ai_addr, _converter_addr->ai_addrlen) < 0) + { + printf("connect to converter failed: %s\n", strerror(errno)); + return -1; + } + // send the convert header + int (*lsend)(int, const void *, size_t, int) = dlsym(RTLD_NEXT, "send"); + return lsend(state->fd, buf, len, 0); } int socket(int domain, int type, int protocol)