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

v1.31 Backports 2025-01-28 #1152

Merged
merged 9 commits into from
Jan 28, 2025
Merged

Conversation

[ upstream commit f352503 ]

The logic that sets the proxylib l7 proto as requested application
protocol on the network socket has been extracted from the function
`extractSocketMetadata`.

But, the test bpfmetadata config still contains this functionality.

Therefore, this commit removes setting the requested application protocol
on the network socket in the test bpfmetadata config. Tests that rely
on this functionality should do this in the setup explicitly.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 5276498 ]

Currently, `extractSocketMetadata` also restores the local address
for the use by the `OriginalDestCluster`.

To keep the function free of side-effects, the logic that restores the
local address gets extracted into a function within the `SocketMetadata`
that gets called from the BPF metadata listener after extracting the
BPF metadata from the socket.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 7717128 ]

According to the Envoy sourcecode, restoration of the local
address should only be performed if it changes from the
current local address.

```
... This should only be called when restoring the original destination address
of a connection redirected by iptables REDIRECT. The caller is responsible for
making sure the new address is actually different.
```

Therefore, this commit introduces a check before restoring the local address.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 011a335 ]

This commit adds the socket filedescriptor to the logmessage
when entering the `onAccept` method on the BPFMetadata listener filter.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit fcca05e ]

This commit changes some usages of `ENVOY_LOG` to `ENVOY_CONN_LOG`
to improve correlation of application logs entries with a connection id.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 9ca66e4 ]

This commit aligns the logging for restoration of the local address
for downstream & upstream socket by always logging the socket and
the old & new local address.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 48b547d ]

Currently, the socket options are completely defined in C++
header files. As a result, the bazel BUILD file misses some
dependencies that also result to clangd not working properly
for these files.

This commit prepares the split into C & Header files by introducing
the "empty" *.cc files and fixing the dependencies in the BUILD file.

In the next commit, the logic will be moved.

Signed-off-by: Marco Hofstetter <[email protected]>
[ upstream commit 3720cb0 ]

This commit moves the implementation of the socket options
into the *.cc files.

Signed-off-by: Marco Hofstetter <[email protected]>
…ption

[ upstream commit 090af04 ]

PR #1115 unintentionally changed
that the keep alive socket options are no longer applied on the accepted
downstream socket, instead (due to the usage of Envoy SocketOption) they
are now applied on the corresponding upstream socket.

This commit is reverting this change and adds some helping comments to
the code.

Signed-off-by: Marco Hofstetter <[email protected]>
@mhofstetter mhofstetter marked this pull request as ready for review January 28, 2025 16:08
@mhofstetter mhofstetter requested a review from a team as a code owner January 28, 2025 16:08
@jrajahalme jrajahalme merged commit 08fc488 into v1.31 Jan 28, 2025
5 checks passed
@jrajahalme jrajahalme deleted the pr/v1.31-backport-2025-01-28-04-43 branch January 28, 2025 17:17
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