aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2023-01-20 09:37:24 +0000
committerMauro Sardara <msardara@cisco.com>2023-01-20 11:06:04 +0000
commit3e5e7e22f80bd64b51d3182339c77eccb5109c2e (patch)
treec241a3808e87fd067154b4b3ae0c899001cf46c4
parentcb46ee3d51c1a8b60a97a7774fa2fc724f45317d (diff)
fix(libhicnctrl)/hicn_plugin): copy address to correct offset
Copy address received from vapi into correct ip46address offset Ticket: HICN-826 Change-Id: I1bf23cc0920539f8883b499981f216038e51a8c0 Signed-off-by: Mauro Sardara <msardara@cisco.com> (cherry picked from commit a465d503193cc75052aa5acb9babfdd369cda90c)
-rw-r--r--ctrl/libhicnctrl/src/modules/hicn_plugin/listener.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctrl/libhicnctrl/src/modules/hicn_plugin/listener.c b/ctrl/libhicnctrl/src/modules/hicn_plugin/listener.c
index 0e9c5406d..4d9792256 100644
--- a/ctrl/libhicnctrl/src/modules/hicn_plugin/listener.c
+++ b/ctrl/libhicnctrl/src/modules/hicn_plugin/listener.c
@@ -44,11 +44,11 @@ static vapi_error_e process_ip_info(struct vapi_ctx_s *ctx, void *callback_ctx,
struct listener_data_s *ld = (struct listener_data_s *)callback_ctx;
if (reply->prefix.address.af == ADDRESS_IP4) {
- memcpy(&(ld->listener.local_addr), reply->prefix.address.un.ip4,
+ memcpy(&(ld->listener.local_addr.v4), reply->prefix.address.un.ip4,
IPV4_ADDR_LEN);
ld->listener.family = AF_INET;
} else {
- memcpy(&(ld->listener.local_addr), reply->prefix.address.un.ip6,
+ memcpy(&(ld->listener.local_addr.v6), reply->prefix.address.un.ip6,
IPV6_ADDR_LEN);
ld->listener.family = AF_INET6;
}