From: Alex Stancu Date: Mon, 10 Oct 2022 12:04:55 +0000 (+0300) Subject: Bugfix for VES O1 pnfRegistration - both IPv4 and IPv6 were being used. X-Git-Tag: 1.5.2~1 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=2a5acd3266126317ea201b55cddf0fb05089588c;hp=82d15195f8617207727a8505729c4c2b15383ec3;p=sim%2Fo1-interface.git Bugfix for VES O1 pnfRegistration - both IPv4 and IPv6 were being used. Issue-ID: SIM-103 Change-Id: Id94ff6f0cbef830b1aaf44456d8cf6a6308f2a94 Signed-off-by: Alex Stancu --- 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; + } } }