Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auditbeat][Metricbeat] Cherry-pick #12248 to 6.8: Fix direction of incoming IPv6 sockets #12251

Merged
merged 1 commit into from
May 23, 2019

Conversation

cwurm
Copy link
Contributor

@cwurm cwurm commented May 23, 2019

Cherry-pick of PR #12248 to 6.8 branch. Original message:

To determine the direction of a socket, we save the list of listening sockets and match non-listening sockets to them. If we find a match, the non-listening socket is Incoming, otherwise Outgoing.

A problem occurs when matching an IPv6 socket listening on all interfaces (::) with an IPv6 socket that has an IPv4-mapped IPv6 addresses (e.g. ::ffff:127.0.0.1). Golang's To4() will determine it is an IPv4 address and miss the listening IPv6 socket.

With this PR, we specify the IP family explicitly instead of trying to determine it from the IP address.

Fixes #3306.

…ic#12248)

To determine the direction of a socket, we save the list of listening sockets and match non-listening sockets to them. If we find a match, the non-listening socket is `Incoming`, otherwise `Outgoing`.

A problem occurs when matching an IPv6 socket listening on all interfaces (`::`) with an IPv6 socket that has an IPv4-mapped IPv6 address (e.g. `::ffff:127.0.0.1`). Golang's `To4()` will determine it is an IPv4 address and miss the listening IPv6 socket.

With this PR, we specify the IP family explicitly instead of trying to determine it from the IP address.

Fixes elastic#3306.

(cherry picked from commit 5dcc369)
@cwurm cwurm changed the title Cherry-pick #12248 to 6.8: [Auditbeat][Metricbeat] Fix direction of incoming IPv6 sockets [Auditbeat][Metricbeat] Cherry-pick #12248 to 6.8: Fix direction of incoming IPv6 sockets May 23, 2019
@cwurm cwurm merged commit c17c27e into elastic:6.8 May 23, 2019
@cwurm cwurm deleted the backport_12248_6.8 branch May 23, 2019 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants