summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibor Peltan <libor.peltan@nic.cz>2024-10-11 11:56:20 +0200
committerDaniel Salzman <daniel.salzman@nic.cz>2024-10-11 19:24:49 +0200
commit20be04fa97e14dee275bb29ac9302dbc651b6236 (patch)
tree1dc2ae8832e91fddc45a1326cda2c13d068a1b04 /src
parentMerge branch 'doc_retire_ksk' into 'master' (diff)
downloadknot-20be04fa97e14dee275bb29ac9302dbc651b6236.tar.xz
knot-20be04fa97e14dee275bb29ac9302dbc651b6236.zip
kxdpgun: block eventual creation of conns when recvd initial...
...just to make sure
Diffstat (limited to 'src')
-rw-r--r--src/libknot/quic/quic.c4
-rw-r--r--src/libknot/quic/quic_conn.h6
-rw-r--r--src/utils/kxdpgun/main.c1
3 files changed, 10 insertions, 1 deletions
diff --git a/src/libknot/quic/quic.c b/src/libknot/quic/quic.c
index 91c898212..bca868433 100644
--- a/src/libknot/quic/quic.c
+++ b/src/libknot/quic/quic.c
@@ -631,6 +631,10 @@ int knot_quic_handle(knot_quic_table_t *table, knot_quic_reply_t *reply,
goto finish;
}
+ if (conn == NULL && (table->flags & KNOT_QUIC_TABLE_CLIENT_ONLY)) {
+ return KNOT_EOK;
+ }
+
if (conn != NULL && (conn->flags & KNOT_QUIC_CONN_BLOCKED)) {
return KNOT_EOK;
}
diff --git a/src/libknot/quic/quic_conn.h b/src/libknot/quic/quic_conn.h
index 49e063169..b19d50e0b 100644
--- a/src/libknot/quic/quic_conn.h
+++ b/src/libknot/quic/quic_conn.h
@@ -106,8 +106,12 @@ typedef struct knot_quic_cid {
struct knot_quic_cid *next;
} knot_quic_cid_t;
+typedef enum {
+ KNOT_QUIC_TABLE_CLIENT_ONLY = (1 << 0),
+} knot_quic_table_flag_t;
+
typedef struct knot_quic_table {
- uint32_t flags; // unused yet
+ knot_quic_table_flag_t flags;
size_t size;
size_t usage;
size_t pointers;
diff --git a/src/utils/kxdpgun/main.c b/src/utils/kxdpgun/main.c
index faa853fee..5e10b6d07 100644
--- a/src/utils/kxdpgun/main.c
+++ b/src/utils/kxdpgun/main.c
@@ -371,6 +371,7 @@ void *xdp_gun_thread(void *_ctx)
goto cleanup;
}
quic_table->qlog_dir = ctx->qlog_dir;
+ quic_table->flags |= KNOT_QUIC_TABLE_CLIENT_ONLY;
#else
assert(0);
#endif // ENABLE_QUIC