]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Provide config option for SO_LINGER and enable by default
authorMichalis Pappas <michalis@unikraft.io>
Tue, 20 Feb 2024 04:02:02 +0000 (05:02 +0100)
committerRazvan Deaconescu <razvan.deaconescu@upb.ro>
Fri, 31 May 2024 17:51:28 +0000 (20:51 +0300)
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 <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #52

Config.uk
include/lwipopts.h

index b541695095ac352c10e42415e760b0f15f789cee..1218a7b41e5fada8c7e0ab15c4b6790004c41464 100644 (file)
--- 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
index 66c26f3f3ee649c395e1ed2e717c5ebde603f5c8..710c160f882e6ea0d87413b317d49f5cd0f2da11 100644 (file)
@@ -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 */