aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/linux-cp/lcp_api.c')
-rw-r--r--src/plugins/linux-cp/lcp_api.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/linux-cp/lcp_api.c b/src/plugins/linux-cp/lcp_api.c
index 96aabb114a5..150c302ea8e 100644
--- a/src/plugins/linux-cp/lcp_api.c
+++ b/src/plugins/linux-cp/lcp_api.c
@@ -136,16 +136,18 @@ send_lcp_itf_pair_details (index_t lipi, vl_api_registration_t *rp,
REPLY_MACRO_DETAILS4 (
VL_API_LCP_ITF_PAIR_DETAILS, rp, context, ({
- rmp->phy_sw_if_index = lcp_pair->lip_phy_sw_if_index;
- rmp->host_sw_if_index = lcp_pair->lip_host_sw_if_index;
- rmp->vif_index = lcp_pair->lip_vif_index;
+ rmp->phy_sw_if_index = ntohl (lcp_pair->lip_phy_sw_if_index);
+ rmp->host_sw_if_index = ntohl (lcp_pair->lip_host_sw_if_index);
+ rmp->vif_index = ntohl (lcp_pair->lip_vif_index);
rmp->host_if_type = api_encode_host_type (lcp_pair->lip_host_type);
memcpy_s (rmp->host_if_name, sizeof (rmp->host_if_name),
lcp_pair->lip_host_name, vec_len (lcp_pair->lip_host_name));
+ rmp->host_if_name[vec_len (lcp_pair->lip_host_name)] = 0;
- clib_strncpy ((char *) rmp->namespace, (char *) lcp_pair->lip_namespace,
- vec_len (lcp_pair->lip_namespace));
+ memcpy_s (rmp->namespace, sizeof (rmp->namespace),
+ lcp_pair->lip_namespace, vec_len (lcp_pair->lip_namespace));
+ rmp->namespace[vec_len (lcp_pair->lip_namespace)] = 0;
}));
}