aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-21 16:23:09 -0800
committerDamjan Marion <dmarion@me.com>2018-12-22 08:07:21 +0000
commit66a1003f1707c16b183aafb19f7208c4f5641965 (patch)
treef21a96444d96e5a76b49cfec81ff9e857285719b /src/vat
parent844a36d1a69625f7a7781c9f82b276cbbc748033 (diff)
bapi/vat: fix socket transport for vat
Change-Id: I8e39df129f80c8d3d73181fc5d3ac60ae382a6b6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index 55f5197b5eb..f39c9e62ae5 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -91,9 +91,15 @@ vl (void *p)
int
vat_socket_connect (vat_main_t * vam)
{
+ int rv;
vam->socket_client_main = &socket_client_main;
- return vl_socket_client_connect ((char *) vam->socket_name, "vpp_api_test",
- 0 /* default socket rx, tx buffer */ );
+ if ((rv = vl_socket_client_connect ((char *) vam->socket_name,
+ "vpp_api_test",
+ 0 /* default socket rx, tx buffer */ )))
+ return rv;
+ /* vpp expects the client index in network order */
+ vam->my_client_index = htonl (socket_client_main.client_index);
+ return 0;
}
#else /* vpp built-in case, we don't do sockets... */
int