Bugfix for VES O1 pnfRegistration - both IPv4 and IPv6 were being used. 29/9229/1
authorAlex Stancu <alexandru.stancu@highstreet-technologies.com>
Mon, 10 Oct 2022 12:04:55 +0000 (15:04 +0300)
committerAlex Stancu <alexandru.stancu@highstreet-technologies.com>
Mon, 10 Oct 2022 12:05:07 +0000 (15:05 +0300)
Issue-ID: SIM-103
Change-Id: Id94ff6f0cbef830b1aaf44456d8cf6a6308f2a94
Signed-off-by: Alex Stancu <alexandru.stancu@highstreet-technologies.com>
ntsimulator/ntsim-ng/features/ves_o1_pnf_registration/ves_o1_pnf_registration.c

index 077a3c4..70d3085 100644 (file)
@@ -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;
+            }
         }
     }