diff options
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/session/session_node.c | 2 | ||||
-rw-r--r-- | src/vnet/session/transport_types.h | 1 | ||||
-rw-r--r-- | src/vnet/udp/udp.c | 6 | ||||
-rw-r--r-- | src/vnet/udp/udp.h | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index 7d727b7e008..0290fe69544 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -125,7 +125,7 @@ session_mq_connect_handler (void *data) 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); diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h index b97955f5671..e065ed1fa59 100644 --- a/src/vnet/session/transport_types.h +++ b/src/vnet/session/transport_types.h @@ -195,6 +195,7 @@ typedef struct transport_endpoint_ 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 \ diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c index ba1821a5026..3632204f863 100644 --- a/src/vnet/udp/udp.c +++ b/src/vnet/udp/udp.c @@ -284,7 +284,11 @@ udp_session_cleanup (u32 connection_index, u32 thread_index) { 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); } diff --git a/src/vnet/udp/udp.h b/src/vnet/udp/udp.h index 736e3ce94f1..9e1aad6fbe5 100644 --- a/src/vnet/udp/udp.h +++ b/src/vnet/udp/udp.h @@ -39,6 +39,7 @@ typedef enum _(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 { @@ -258,6 +259,7 @@ udp_connection_clone_safe (u32 connection_index, u32 thread_index) 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); |