For IP_RECVERR never returning the error structures that the option
enables is a valid implementation. A proper implementation would require
changes to the LWIP codebase. For TCP_FASTOPEN, it would only improve
the latency and therefore we can safely ignore the option.
Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Mihnea Firoiu <mihneafiroiu0@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #46
return ret;
}
+#define LINUX_SOL_TCP 6
+#define LINUX_TCP_FASTOPEN 23
+
static int
lwip_posix_socket_setsockopt(posix_sock *file, int level,
int optname, const void *optval, socklen_t optlen)
lwip_fd = _lwip_getfd(file);
UK_ASSERT(lwip_fd >= 0);
+ if ((level == LINUX_SOL_TCP && optname == LINUX_TCP_FASTOPEN) ||
+ (level == SOL_IP && optname == IP_RECVERR)) {
+ /* Ignore stuff that LWIP doesn't support */
+ return 0;
+ }
ret = lwip_setsockopt(lwip_fd, level, optname, optval, optlen);
if (unlikely(ret < 0))
ret = -errno;