summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c5
-rwxr-xr-xsrc/vnet/session/session_cli.c37
-rw-r--r--src/vnet/session/session_lookup.c8
3 files changed, 12 insertions, 38 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 4544f9a0f93..792e6612dc1 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -267,10 +267,7 @@ stream_session_enqueue_data (transport_connection_t * tc, vlib_buffer_t * b,
}
}
- if (is_in_order)
- return enqueued;
-
- return 0;
+ return enqueued;
}
/** Check if we have space in rx fifo to push more bytes */
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index d9f516beab9..8c30a1df7eb 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -127,13 +127,8 @@ unformat_stream_session_id (unformat_input_t * input, va_list * args)
*is_ip4 = 0;
tuple_is_set = 1;
}
- else
- return 0;
-
- if (tuple_is_set)
- return 1;
- return 0;
+ return tuple_is_set;
}
uword
@@ -144,21 +139,12 @@ unformat_stream_session (unformat_input_t * input, va_list * args)
u8 proto = ~0;
ip46_address_t lcl, rmt;
u32 lcl_port = 0, rmt_port = 0;
- u8 is_ip4 = 0, s_type = ~0, id_is_set = 0;
+ u8 is_ip4 = 0, s_type = ~0;
- if (unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
- &lcl_port, &rmt_port, &is_ip4))
- {
- id_is_set = 1;
- }
- else
+ if (!unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
+ &lcl_port, &rmt_port, &is_ip4))
return 0;
- if (!id_is_set)
- {
- return 0;
- }
-
s_type = session_type_from_proto_and_ip (proto, is_ip4);
if (is_ip4)
s = stream_session_lookup4 (&lcl.ip4, &rmt.ip4,
@@ -185,21 +171,12 @@ unformat_transport_connection (unformat_input_t * input, va_list * args)
u8 proto = ~0;
ip46_address_t lcl, rmt;
u32 lcl_port = 0, rmt_port = 0;
- u8 is_ip4 = 0, s_type = ~0, id_is_set = 0;
+ u8 is_ip4 = 0, s_type = ~0;
- if (unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
- &lcl_port, &rmt_port, &is_ip4))
- {
- id_is_set = 1;
- }
- else
+ if (!unformat (input, "%U", unformat_stream_session_id, &proto, &lcl, &rmt,
+ &lcl_port, &rmt_port, &is_ip4))
return 0;
- if (!id_is_set)
- {
- return 0;
- }
-
proto = (proto == (u8) ~ 0) ? suggested_proto : proto;
if (proto == (u8) ~ 0)
return 0;
diff --git a/src/vnet/session/session_lookup.c b/src/vnet/session/session_lookup.c
index 0f9abf9aa74..4487b1c305f 100644
--- a/src/vnet/session/session_lookup.c
+++ b/src/vnet/session/session_lookup.c
@@ -233,15 +233,15 @@ stream_session_half_open_table_add (transport_connection_t * tc, u64 value)
{
make_v4_ss_kv_from_tc (&kv4, tc);
kv4.value = value;
- clib_bihash_add_del_16_8 (&sl->v4_half_open_hash, &kv4,
- 1 /* is_add */ );
+ (void) clib_bihash_add_del_16_8 (&sl->v4_half_open_hash, &kv4,
+ 1 /* is_add */ );
}
else
{
make_v6_ss_kv_from_tc (&kv6, tc);
kv6.value = value;
- clib_bihash_add_del_48_8 (&sl->v6_half_open_hash, &kv6,
- 1 /* is_add */ );
+ (void) clib_bihash_add_del_48_8 (&sl->v6_half_open_hash, &kv6,
+ 1 /* is_add */ );
}
}