git: cd34d8dea4ad - main - linux: Translate IPv6 hoplimit ancillary data for recvmsg
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Apr 2026 07:22:54 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a
commit cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a
Author: Ricardo Branco <rbranco@suse.de>
AuthorDate: 2026-04-12 14:43:05 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-04-17 07:22:44 +0000
linux: Translate IPv6 hoplimit ancillary data for recvmsg
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: pouria
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2138
---
sys/compat/linux/linux_socket.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 2d20751a41aa..29b55ef60357 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -707,6 +707,20 @@ bsd_to_linux_ip_cmsg_type(int cmsg_type)
return (-1);
}
+#ifdef INET6
+static int
+bsd_to_linux_ip6_cmsg_type(int cmsg_type)
+{
+ switch (cmsg_type) {
+ case IPV6_2292HOPLIMIT:
+ return (LINUX_IPV6_2292HOPLIMIT);
+ case IPV6_HOPLIMIT:
+ return (LINUX_IPV6_HOPLIMIT);
+ }
+ return (-1);
+}
+#endif
+
static int
bsd_to_linux_cmsg_type(struct proc *p, int cmsg_type, int cmsg_level)
{
@@ -714,6 +728,10 @@ bsd_to_linux_cmsg_type(struct proc *p, int cmsg_type, int cmsg_level)
if (cmsg_level == IPPROTO_IP)
return (bsd_to_linux_ip_cmsg_type(cmsg_type));
+#ifdef INET6
+ if (cmsg_level == IPPROTO_IPV6)
+ return (bsd_to_linux_ip6_cmsg_type(cmsg_type));
+#endif
if (cmsg_level != SOL_SOCKET)
return (-1);