#define QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED (1U << 0)
#define QUIC_FL_CONN_SPIN_BIT (1U << 1) /* Spin bit set by remote peer */
#define QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS (1U << 2) /* HANDSHAKE_DONE must be sent */
-/* gap here */
+#define QUIC_FL_CONN_IS_BACK (1U << 3) /* conn used on backend side */
#define QUIC_FL_CONN_ACCEPT_REGISTERED (1U << 4)
#define QUIC_FL_CONN_UDP_GSO_EIO (1U << 5) /* GSO disabled due to a EIO occured on same listener */
#define QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ (1U << 6)
_(QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED,
_(QUIC_FL_CONN_SPIN_BIT,
_(QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS,
+ _(QUIC_FL_CONN_IS_BACK,
_(QUIC_FL_CONN_ACCEPT_REGISTERED,
_(QUIC_FL_CONN_UDP_GSO_EIO,
_(QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ,
_(QUIC_FL_CONN_EXP_TIMER,
_(QUIC_FL_CONN_CLOSING,
_(QUIC_FL_CONN_DRAINING,
- _(QUIC_FL_CONN_IMMEDIATE_CLOSE))))))))))))))))))))))));
+ _(QUIC_FL_CONN_IMMEDIATE_CLOSE)))))))))))))))))))))))));
/* epilogue */
_(~0U);
return buf;
int quic_stateless_reset_token_cpy(unsigned char *pos, size_t len,
const unsigned char *salt, size_t saltlen);
+/* Returns true if <qc> is used on the backed side (as a client). */
+static inline int qc_is_back(const struct quic_conn *qc)
+{
+ return qc->flags & QUIC_FL_CONN_IS_BACK;
+}
+
/* Free the CIDs attached to <conn> QUIC connection. */
static inline void free_quic_conn_cids(struct quic_conn *conn)
{
else {
struct quic_connection_id *conn_cid = NULL;
- qc->flags = QUIC_FL_CONN_PEER_VALIDATED_ADDR;
+ qc->flags = QUIC_FL_CONN_IS_BACK|QUIC_FL_CONN_PEER_VALIDATED_ADDR;
qc->state = QUIC_HS_ST_CLIENT_INITIAL;
/* This is the original connection ID from the peer server
if (qc) {
const struct quic_tls_ctx *tls_ctx;
- chunk_appendf(&trace_buf, " : qc@%p idle_timer_task@%p flags=0x%x",
- qc, qc->idle_timer_task, qc->flags);
+ chunk_appendf(&trace_buf, " : qc@%p(%c) idle_timer_task@%p flags=0x%x",
+ qc, (qc->flags & QUIC_FL_CONN_IS_BACK) ? 'B' : 'F',
+ qc->idle_timer_task, qc->flags);
if (mask & QUIC_EV_CONN_NEW) {
const int *ssl_err = a2;