aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-12-02 14:28:22 +0100
committerLuca Muscariello <muscariello@ieee.org>2019-12-04 09:45:43 +0000
commit2bfd3335ff11281d703cb7f422bb17da2d3a6bcd (patch)
tree278c097859d17c3f96c84d432ab1ef5c80e9a6d2 /ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
parent3e0ff4e7897bb8bc03538f1b2643fe73de158714 (diff)
to fix HICN-421 by adding cpack to libyang and sysrepo
Signed-off-by: Luca Muscariello <muscariello@ieee.org> Change-Id: Ia9e0752f877c7fc0be6df85664d18e1caad86741 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c')
-rw-r--r--ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
index 305512af3..8db0a6238 100644
--- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
+++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
@@ -296,7 +296,7 @@ vapi_error_e call_hicn_api_node_params_set(struct vapi_ctx_s *ctx,
}
static inline void state_update(sr_val_t * vals, struct lyd_node **parent, sr_session_ctx_t *session){
- char buf[20];
+ char buf[20];
//struct ly_ctx *ly_ctx = sr_get_context(sr_session_get_connection(session));
sr_val_set_xpath(&vals[0], "/hicn:hicn-state/states/pkts_processed");
vals[0].type = SR_UINT64_T;
@@ -420,12 +420,12 @@ static inline int routes_update(sr_val_t * vals, uint32_t nleaves, struct lyd_n
memset(buf, 0x00, 20);
if (temp->route.prefix.address.af==ADDRESS_IP4){
struct sockaddr_in sa;
- memcpy(&sa.sin_addr.s_addr,temp->route.prefix.address.un.ip4,INET_ADDRSTRLEN);
+ memcpy(&sa.sin_addr.s_addr, temp->route.prefix.address.un.ip4, IPV4_ADDR_LEN);
inet_ntop(AF_INET, &(sa.sin_addr), buf, INET_ADDRSTRLEN);
vals[route].data.string_val = buf;
}else{
struct sockaddr_in6 sa;
- memcpy(&sa.sin6_addr,temp->route.prefix.address.un.ip6,INET6_ADDRSTRLEN);
+ memcpy(&sa.sin6_addr,temp->route.prefix.address.un.ip6, IPV6_ADDR_LEN);
inet_ntop(AF_INET6, &(sa.sin6_addr), buf, INET6_ADDRSTRLEN);
vals[route].data.string_val = buf;
}
@@ -443,7 +443,7 @@ static inline int routes_update(sr_val_t * vals, uint32_t nleaves, struct lyd_n
memset(buf, 0x00, 20);
sprintf( buf, "%d", temp->route.strategy_id);
lyd_new_path(*parent, NULL, vals[route].xpath, buf, 0, 0);
-
+
route++;
temp=temp->next;