else if (unformat (a, "quic-setup %U", quic_echo_unformat_setup_vft))
;
else if (unformat (a, "uni"))
- em->connect_flag = SESSION_F_UNIDIRECTIONAL;
+ em->connect_flag = TRANSPORT_CFG_F_UNIDIRECTIONAL;
else if (unformat (a, "qclose=%U",
echo_unformat_close, &eqm->send_quic_disconnects))
;
app_worker_t *app_wrk;
quic_ctx_t *qctx, *sctx;
u32 sctx_index;
+ u8 is_unidir;
int rv;
/* Find base session to which the user want to attach a stream */
if (!conn || !quicly_connection_is_ready (conn))
return -1;
- if ((rv =
- quicly_open_stream (conn, &stream,
- sep->flags & SESSION_F_UNIDIRECTIONAL)))
+ is_unidir = sep->transport_flags & TRANSPORT_CFG_F_UNIDIRECTIONAL;
+ if ((rv = quicly_open_stream (conn, &stream, is_unidir)))
{
QUIC_DBG (2, "Stream open failed with %d", rv);
return -1;
stream_session->listener_handle = quic_session_handle;
stream_session->session_type =
session_type_from_proto_and_ip (TRANSPORT_PROTO_QUIC, qctx->udp_is_ip4);
- if (sep->flags & SESSION_F_UNIDIRECTIONAL)
+ if (is_unidir)
stream_session->flags |= SESSION_F_UNIDIRECTIONAL;
sctx->c_s_index = stream_session->session_index;
typedef enum vcl_session_flags_
{
- VCL_SESSION_F_CONNECTED,
+ VCL_SESSION_F_CONNECTED = 1 << 0,
} __clib_packed vcl_session_flags_t;
typedef struct
a->sep_ext.parent_handle = mp->parent_handle;
a->sep_ext.ckpair_index = mp->ckpair_index;
a->sep_ext.crypto_engine = mp->crypto_engine;
- a->sep_ext.flags = mp->flags;
+ a->sep_ext.transport_flags = mp->flags;
if (mp->hostname_len)
{
vec_validate (a->sep_ext.hostname, mp->hostname_len - 1);
typedef enum transport_endpt_cfg_flags_
{
TRANSPORT_CFG_F_CONNECTED = 1 << 0,
+ TRANSPORT_CFG_F_UNIDIRECTIONAL = 1 << 1,
} transport_endpt_cfg_flags_t;
#define foreach_transport_endpoint_cfg_fields \
{
udp_connection_t *uc;
uc = udp_connection_get (connection_index, thread_index);
- if (uc)
+ if (!uc)
+ return;
+ if (uc->flags & UDP_CONN_F_MIGRATED)
+ udp_connection_free (uc);
+ else
udp_connection_cleanup (uc);
}
_(OWNS_PORT, "OWNS_PORT") /**< port belong to conn (UDPC) */ \
_(CLOSING, "CLOSING") /**< conn closed with data */ \
_(LISTEN, "LISTEN") /**< conn is listening */ \
+ _(MIGRATED, "MIGRATED") /**< cloned to another thread */ \
enum udp_conn_flags_bits
{
udp_pool_add_peeker (thread_index);
old_c = udp_main.connections[thread_index] + connection_index;
clib_memcpy_fast (new_c, old_c, sizeof (*new_c));
+ old_c->flags |= UDP_CONN_F_MIGRATED;
udp_pool_remove_peeker (thread_index);
new_c->c_thread_index = current_thread_index;
new_c->c_c_index = udp_connection_index (new_c);