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

chore(transport): Use socket2 to obtain orig_dst #3626

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

zaharidichev
Copy link
Member

The code that we currently use to obtain orig_dst has been borrowed from net2-rs.
Since we already have socket2 in our dependency tree, we can simplify the logic by
just using socket2. An added benefit of that is that socket2 provides support for
obtaining orig_dst on Windows.

Signed-off-by: Zahari Dichev zaharidichev@gmail.com

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
@zaharidichev zaharidichev requested a review from a team as a code owner February 19, 2025 17:16
@zaharidichev zaharidichev changed the title chore(transport): User socket2 to obtain orig_dst chore(transport): Use socket2 to obtain orig_dst Feb 19, 2025
@olix0r olix0r merged commit b8cc2d0 into main Feb 19, 2025
15 checks passed
@olix0r olix0r deleted the zd/use-socket2-for-orig_dst branch February 19, 2025 19:05
alpeb added a commit that referenced this pull request Mar 20, 2025
In #3626, we refactored the origin_dst determination logic to utilize
socket2 calls. However, this change inadvertently disrupted IPv6 and
dual-stack support, causing the server to fail to start when deployed on
such network configurations:

```
WARN ThreadId(01) inbound: linkerd_app_core::serve: Server failed to accept connection error=No such file or directory (os error 2)
```

This change reintroduces detection of the current network family,
calling socket2's `original_dst()` or `original_dst_ipv6()` depending on
the case.

Tested fine in both IPv6 and dual-stack Kind clusters.
olix0r pushed a commit that referenced this pull request Mar 21, 2025
In #3626, we refactored the origin_dst determination logic to utilize
socket2 calls. However, this change inadvertently disrupted IPv6 and
dual-stack support, causing the server to fail to start when deployed on
such network configurations:

```
WARN ThreadId(01) inbound: linkerd_app_core::serve: Server failed to accept connection error=No such file or directory (os error 2)
```

This change reintroduces detection of the current network family,
calling socket2's `original_dst()` or `original_dst_ipv6()` depending on
the case.

Tested fine in both IPv6 and dual-stack Kind clusters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants