aboutgitcodebugslistschat
path: root/tcp_conn.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-02-14 10:48:22 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-02-14 17:25:11 +0100
commitdc467d526fa2f2f4589b175c42f77b5977ad5975 (patch)
treec35013ef7913ab584385799e9ca9a15bbf235ad4 /tcp_conn.h
parent912d37cd5b8c507d17f38758d50ff3ba0401a99c (diff)
downloadpasst-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar.gz
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar.bz2
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar.lz
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar.xz
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.tar.zst
passt-dc467d526fa2f2f4589b175c42f77b5977ad5975.zip
tcp: Split pool lookup from creating new sockets in tcp_conn_new_sock()
tcp_conn_new_sock() first looks for a socket in a pre-opened pool, then if that's empty creates a new socket in the init namespace. Both parts of this are duplicated in other places: the pool lookup logic is duplicated in tcp_splice_new(), and the socket opening logic is duplicated in tcp_sock_refill_pool(). Split the function into separate parts so we can remove both these duplications. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_conn.h')
-rw-r--r--tcp_conn.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tcp_conn.h b/tcp_conn.h
index 9951b0a..c807e8b 100644
--- a/tcp_conn.h
+++ b/tcp_conn.h
@@ -192,6 +192,7 @@ void tcp_splice_conn_update(struct ctx *c, struct tcp_splice_conn *new);
void tcp_table_compact(struct ctx *c, union tcp_conn *hole);
void tcp_splice_destroy(struct ctx *c, union tcp_conn *conn_union);
void tcp_splice_timer(struct ctx *c, union tcp_conn *conn_union);
+int tcp_conn_pool_sock(int pool[]);
void tcp_sock_refill_pool(const struct ctx *c, int pool[], int af);
void tcp_splice_refill(const struct ctx *c);