Skip to content

Commit 8944dc3

Browse files
committed
fix struct sockaddr version check
* sa_data_min field was introduced on v5.15.150, removed on v5.16 and reintroduced on v6.1.80
1 parent 915c6ac commit 8944dc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/luasocket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ do { \
4646

4747
#define LUASOCKET_SOCKADDR(addr) (struct sockaddr *)&addr, sizeof(addr)
4848
#define LUASOCKET_ADDRMAX (sizeof(struct sockaddr_ll)) /* AF_PACKET */
49-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 150)
49+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 150) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)) \
50+
|| LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 80)
5051
#define LUASOCKET_ADDRMIN(addr) (sizeof((addr)->sa_data_min))
5152
#else
5253
#define LUASOCKET_ADDRMIN(addr) (sizeof((addr)->sa_data))

0 commit comments

Comments
 (0)