diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2025-12-02 15:02:11 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-12-02 23:07:30 +0100 |
| commit | e77cbf06b99ef3795344b239dc28e6a67bbb1eea (patch) | |
| tree | ff9412e2a650ab012adcc46cc56ecf4b9237edb4 /test/lib/git: | |
| parent | e6f6eb24b1945f3c271f0b49fd60b9944e85439d (diff) | |
| download | passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar.gz passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar.bz2 passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar.lz passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar.xz passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.tar.zst passt-e77cbf06b99ef3795344b239dc28e6a67bbb1eea.zip | |
tcp, udp: Remove fallback if creating dual stack socket fails
To save kernel memory we try to use "dual stack" sockets which can listen
for both IPv4 and IPv6 connections where possible. To support kernels
which don't allow dual stack sockets, we fall back to creating individual
sockets for IPv4 and IPv6.
This fallback causes some mild ugliness now, and will cause more difficulty
with upcoming improvements to the forwarding logic. I don't think we need
the fallback on the following grounds:
1) The fallback was broken since inception:
The fallback was triggered if pif_sock_l4() failed attempting to create the
dual stack socket. But even if the kernel didn't support them,
pif_sock_l4() would not report a failure.
- Dual stack sockets are distinguished by having the IPV6_V6ONLY sockopt
set to 0. However, until the last patch, we only called setsockopt()
if we wanted to set this to 1, so there was no kernel operation which
could fail for dual stack sockets - we'd silently create a IPv6 only
socket instead.
- Even if we did call the setsockopt(), we only printed a debug() message
for failures, we didn't report it to the caller
2) Dual stack sockets are not just a Linux extension
The dual stack socket interface is described in RFC3493, specifically
section 3.7 and section 5.3. It is supported on BSD:
https://man.freebsd.org/cgi/man.cgi?query=ip6
and on Windows:
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options
3) Linux has supported dual stack sockets for over 20 years
According to ipv6(7) the IPV6_V6ONLY socket option was introduced in
Linux 2.6 and Linux 2.4.21 both from 2003.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/lib/git:')
0 files changed, 0 insertions, 0 deletions
