Description
Building the module fails on Debian 13 (trixie) with kernel 6.12.90+deb13.1 due to a recvmsg function signature mismatch.
Error
/usr/src/quic-git/modules/net/quic/socket.c:2868:28: error: initialization of
'int (*)(struct sock *, struct msghdr *, size_t, int, int *)' from incompatible
pointer type 'int (*)(struct sock *, struct msghdr *, size_t, int)'
[-Wincompatible-pointer-types]
2868 | .recvmsg = quic_recvmsg,
Root Cause
In socket.c, the guard used to select the quic_recvmsg signature is:
#ifdef IP_TUNNEL_RECURSION_LIMIT
static int quic_recvmsg(struct sock *sk, struct msghdr *msg, size_t msg_len,
int flags) // 4 params (old kernel)
#else
static int quic_recvmsg(struct sock *sk, struct msghdr *msg, size_t msg_len,
int flags, int *addr_len) // 5 params (new kernel)
#endif
On Debian kernel 6.12, IP_TUNNEL_RECURSION_LIMIT is defined (value 5) in include/net/ip_tunnels.h, so the 4-parameter variant is compiled. However, struct proto.recvmsg on this kernel expects the 5-parameter signature (with int *addr_len), causing the type mismatch.
$ grep -r "IP_TUNNEL_RECURSION_LIMIT" /usr/src/linux-headers-6.12.90+deb13.1-common/include/
/usr/src/linux-headers-6.12.90+deb13.1-common/include/net/ip_tunnels.h:#define IP_TUNNEL_RECURSION_LIMIT 5
Suggested Fix
Replace the IP_TUNNEL_RECURSION_LIMIT guard with a proper kernel version check, which is the only reliable way to detect this signature change:
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
static int quic_recvmsg(struct sock *sk, struct msghdr *msg, size_t msg_len,
int flags)
#else
static int quic_recvmsg(struct sock *sk, struct msghdr *msg, size_t msg_len,
int flags, int *addr_len)
#endif
Environment
- OS: Debian 13 (trixie)
- Kernel: 6.12.90+deb13.1-amd64
- Headers: linux-headers-6.12.90+deb13.1-amd64 / linux-headers-6.12.90+deb13.1-common
Description
Building the module fails on Debian 13 (trixie) with kernel 6.12.90+deb13.1 due to a
recvmsgfunction signature mismatch.Error
Root Cause
In
socket.c, the guard used to select thequic_recvmsgsignature is:On Debian kernel 6.12,
IP_TUNNEL_RECURSION_LIMITis defined (value5) ininclude/net/ip_tunnels.h, so the 4-parameter variant is compiled. However,struct proto.recvmsgon this kernel expects the 5-parameter signature (withint *addr_len), causing the type mismatch.Suggested Fix
Replace the
IP_TUNNEL_RECURSION_LIMITguard with a proper kernel version check, which is the only reliable way to detect this signature change:Environment