aboutgitcodebugslistschat
path: root/tcp.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-11-17 16:59:02 +1100
committerStefano Brivio <sbrivio@redhat.com>2022-11-25 01:35:48 +0100
commit034fa8a58d87ad2ea5f8b56d267d17dbc75798de (patch)
treef635dc58f88475a526b2229e8ea68ebaa56616ec /tcp.h
parent7f1f2f3f518eace6ee08a00158189aaf571f3dcb (diff)
downloadpasst-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar.gz
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar.bz2
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar.lz
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar.xz
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.tar.zst
passt-034fa8a58d87ad2ea5f8b56d267d17dbc75798de.zip
tcp: Remove v6 flag from tcp_epoll_ref
This bit in the TCP specific epoll reference indicates whether the connection is IPv6 or IPv4. However the sites which refer to it are already calling accept() which (optionally) returns an address for the remote end of the connection. We can use the sa_family field in that address to determine the connection type independent of the epoll reference. This does have a cost: for the spliced case, it means we now need to get that address from accept() which introduces an extran copy_to_user(). However, in future we want to allow handling IPv4 connectons through IPv6 sockets, which means we won't be able to determine the IP version at the time we create the listening socket and epoll reference. So, at some point we'll have to pay this cost anyway. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.h')
-rw-r--r--tcp.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/tcp.h b/tcp.h
index a940682..739b451 100644
--- a/tcp.h
+++ b/tcp.h
@@ -33,7 +33,6 @@ void tcp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s,
* union tcp_epoll_ref - epoll reference portion for TCP connections
* @listen: Set if this file descriptor is a listening socket
* @outbound: Listening socket maps to outbound, spliced connection
- * @v6: Set for IPv6 sockets or connections
* @timer: Reference is a timerfd descriptor for connection
* @index: Index of connection in table, or port for bound sockets
* @u32: Opaque u32 value of reference
@@ -42,7 +41,6 @@ union tcp_epoll_ref {
struct {
uint32_t listen:1,
outbound:1,
- v6:1,
timer:1,
index:20;
} tcp;