aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_interface.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-09-19 22:27:18 -0700
committerDave Wallace <dwallacelf@gmail.com>2017-09-20 17:50:48 +0000
commit0e4956869b7b919957433f04cc8fe52a2f391251 (patch)
tree29171e94f2315f342bc3160d920b6dccfae95f0f /src/vnet/session/application_interface.c
parent392206e55a1cbfb0a2e03ae310a4d3953bf3f194 (diff)
session: store tep port in net order
Change-Id: Ie3a99f09f44ec081d9b88a213bdb8d987fb462de Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application_interface.c')
-rw-r--r--src/vnet/session/application_interface.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c
index 8dbc3a1ab19..7e7449aa161 100644
--- a/src/vnet/session/application_interface.c
+++ b/src/vnet/session/application_interface.c
@@ -92,9 +92,7 @@ vnet_bind_i (u32 app_index, session_type_t sst,
return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
}
- listener = stream_session_lookup_listener (&tep->ip,
- clib_host_to_net_u16 (tep->port),
- sst);
+ listener = stream_session_lookup_listener (&tep->ip, tep->port, sst);
if (listener)
return VNET_API_ERROR_ADDRESS_IN_USE;
@@ -131,9 +129,7 @@ vnet_connect_i (u32 app_index, u32 api_context, session_type_t sst,
/*
* Figure out if connecting to a local server
*/
- listener = stream_session_lookup_listener (&tep->ip,
- clib_host_to_net_u16 (tep->port),
- sst);
+ listener = stream_session_lookup_listener (&tep->ip, tep->port, sst);
if (listener)
{
server = application_get (listener->app_index);
@@ -181,6 +177,7 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args)
&tep->port))
{
*sst = SESSION_TYPE_IP4_TCP;
+ tep->port = clib_host_to_net_u16 (tep->port);
tep->is_ip4 = 1;
return 1;
}
@@ -188,6 +185,7 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args)
&tep->port))
{
*sst = SESSION_TYPE_IP4_UDP;
+ tep->port = clib_host_to_net_u16 (tep->port);
tep->is_ip4 = 1;
return 1;
}
@@ -195,12 +193,14 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args)
&tep->port))
{
*sst = SESSION_TYPE_IP6_UDP;
+ tep->port = clib_host_to_net_u16 (tep->port);
return 1;
}
if (unformat (input, "tcp://%U/%d", unformat_ip6_address, &tep->ip.ip6,
&tep->port))
{
*sst = SESSION_TYPE_IP6_TCP;
+ tep->port = clib_host_to_net_u16 (tep->port);
return 1;
}