Skip to content

Commit

Permalink
V4MAPPED was stripped from OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowman committed May 28, 2021
1 parent a0a68ef commit 1455916
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/input/fds/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const struct in_addr *>(&desc->ip_src[12]);
session_net.addr_dst.ipv4 = *reinterpret_cast<const struct in_addr *>(&desc->ip_dst[12]);
} else {
} else
#endif
{
session_net.l3_proto = AF_INET6;
session_net.addr_src.ipv6 = *reinterpret_cast<const struct in6_addr *>(&desc->ip_src[0]);
session_net.addr_dst.ipv6 = *reinterpret_cast<const struct in6_addr *>(&desc->ip_dst[0]);
Expand Down

0 comments on commit 1455916

Please sign in to comment.