From: Michalis Pappas Date: Tue, 20 Feb 2024 04:02:02 +0000 (+0100) Subject: Provide config option for SO_LINGER and enable by default X-Git-Tag: RELEASE-0.17.0~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1176c04afe3ec91983c6812cdf95ea3b2dd5b8c1;p=unikraft%2Flibs%2Flwip.git Provide config option for SO_LINGER and enable by default Add a Kconfig option that controls support for SO_LINGER, and enable by default. SO_LINGER allows delaying close() by a specified timeout when data is still available in the socket. Signed-off-by: Michalis Pappas Reviewed-by: Andrei Tatar Reviewed-by: Sergiu Moga Approved-by: Razvan Deaconescu GitHub-Closes: #52 --- diff --git a/Config.uk b/Config.uk index b541695..1218a7b 100644 --- a/Config.uk +++ b/Config.uk @@ -192,6 +192,13 @@ config LWIP_RCVBUF help Use receive buffers, enabling the SO_RCVBUF socket option and FIONREAD ioctl +config LWIP_LINGER + bool "Linger on close()" + default y + help + Enables support of the SO_LINGER socket option that allows delaying close() + if data still available in the socket. + config LWIP_LOOPBACK bool "Loopback traffic" default y diff --git a/include/lwipopts.h b/include/lwipopts.h index 66c26f3..710c160 100644 --- a/include/lwipopts.h +++ b/include/lwipopts.h @@ -219,6 +219,10 @@ void sys_free(void *ptr); #define LWIP_SO_RCVBUF 1 #endif +#if CONFIG_LWIP_LINGER +#define LWIP_SO_LINGER 1 +#endif + #if LWIP_SOCKET #if CONFIG_HAVE_LIBC /* Stop lwip to provide ioctl constants */