diff options
| author | Ricardo Branco <rbranco@suse.de> | 2026-04-12 14:43:05 +0000 |
|---|---|---|
| committer | Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org> | 2026-04-17 07:22:44 +0000 |
| commit | cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a (patch) | |
| tree | 50d453eb0e00cf6d11dbd8218d1e88b6436087f2 | |
| parent | caaa7a07fed4a16e753c0064482c0eaa0900607b (diff) | |
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
| -rw-r--r-- | sys/compat/linux/linux_socket.c | 18 |
1 files changed, 18 insertions, 0 deletions
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); |
