From 2a5acd3266126317ea201b55cddf0fb05089588c Mon Sep 17 00:00:00 2001 From: Alex Stancu Date: Mon, 10 Oct 2022 15:04:55 +0300 Subject: [PATCH 1/1] Bugfix for VES O1 pnfRegistration - both IPv4 and IPv6 were being used. Issue-ID: SIM-103 Change-Id: Id94ff6f0cbef830b1aaf44456d8cf6a6308f2a94 Signed-off-by: Alex Stancu --- .../ves_o1_pnf_registration.c | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ntsimulator/ntsim-ng/features/ves_o1_pnf_registration/ves_o1_pnf_registration.c b/ntsimulator/ntsim-ng/features/ves_o1_pnf_registration/ves_o1_pnf_registration.c index 077a3c4..70d3085 100644 --- a/ntsimulator/ntsim-ng/features/ves_o1_pnf_registration/ves_o1_pnf_registration.c +++ b/ntsimulator/ntsim-ng/features/ves_o1_pnf_registration/ves_o1_pnf_registration.c @@ -374,19 +374,22 @@ static cJSON* ves_create_o1_pnf_registration_fields(const char *nf_ip_v4_address return 0; } - if (nf_ip_v4_address != 0 && strlen(nf_ip_v4_address) > 0) { - if(cJSON_AddStringToObject(data, "oam-host", nf_ip_v4_address) == 0) { - log_error("cJSON_AddItemToObject failed\n"); - cJSON_Delete(stnd_defined_fields); - return 0; + if (!framework_environment.settings.ip_v6_enabled) { + if (nf_ip_v4_address != 0 && strlen(nf_ip_v4_address) > 0) { + if(cJSON_AddStringToObject(data, "oam-host", nf_ip_v4_address) == 0) { + log_error("cJSON_AddItemToObject failed\n"); + cJSON_Delete(stnd_defined_fields); + return 0; + } } } - - if (nf_ip_v6_address != 0 && strlen(nf_ip_v6_address) > 0) { - if(cJSON_AddStringToObject(data, "oam-host", nf_ip_v6_address) == 0) { - log_error("cJSON_AddItemToObject failed\n"); - cJSON_Delete(stnd_defined_fields); - return 0; + else { + if (nf_ip_v6_address != 0 && strlen(nf_ip_v6_address) > 0) { + if(cJSON_AddStringToObject(data, "oam-host", nf_ip_v6_address) == 0) { + log_error("cJSON_AddItemToObject failed\n"); + cJSON_Delete(stnd_defined_fields); + return 0; + } } } -- 2.16.6