From 145591622fd58a6b4381e020a3c8fc54d2ba042e Mon Sep 17 00:00:00 2001 From: Chris Cappuccio Date: Thu, 27 May 2021 21:05:55 -0700 Subject: [PATCH] V4MAPPED was stripped from OpenBSD --- src/plugins/input/fds/Reader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/input/fds/Reader.cpp b/src/plugins/input/fds/Reader.cpp index 6e4bab4c..841aaa2b 100644 --- a/src/plugins/input/fds/Reader.cpp +++ b/src/plugins/input/fds/Reader.cpp @@ -97,11 +97,14 @@ Reader::session_from_sid(fds_file_sid_t sid) memset(&session_net, 0, sizeof(session_net)); session_net.port_src = desc->port_src; session_net.port_dst = desc->port_dst; +#ifndef __OpenBSD__ if (IN6_IS_ADDR_V4MAPPED(desc->ip_src) && IN6_IS_ADDR_V4MAPPED(desc->ip_dst)) { session_net.l3_proto = AF_INET; session_net.addr_src.ipv4 = *reinterpret_cast(&desc->ip_src[12]); session_net.addr_dst.ipv4 = *reinterpret_cast(&desc->ip_dst[12]); - } else { + } else +#endif + { session_net.l3_proto = AF_INET6; session_net.addr_src.ipv6 = *reinterpret_cast(&desc->ip_src[0]); session_net.addr_dst.ipv6 = *reinterpret_cast(&desc->ip_dst[0]);