diff --git a/nfapi/oai_integration/nfapi.c b/nfapi/oai_integration/nfapi.c index 545eb0d5b7..2235db4226 100644 --- a/nfapi/oai_integration/nfapi.c +++ b/nfapi/oai_integration/nfapi.c @@ -23,7 +23,7 @@ #include #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/log.h" -static char nfapi_str_mode[6][24] = {"MONOLITHIC","PNF","VNF","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF",""}; +static char nfapi_str_mode[][24] = {"MONOLITHIC","PNF","VNF","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF",""}; typedef struct { nfapi_mode_t nfapi_mode; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 64dd0a30c5..cb7f543950 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -30,6 +30,7 @@ #include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" #include "common/config/config_load_configmodule.h" #include "common/config/config_userapi.h" +#include extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); void configure_nfapi_pnf(char *vnf_ip_addr, @@ -1053,7 +1054,7 @@ int ue_init_standalone_socket(const char *addr, int port) server_address.sin_family = AF_INET; server_address.sin_port = htons(port); - int sd = socket(address.sin_family, SOCK_STREAM, IPPROTO_SCTP); + int sd = socket(server_address.sin_family, SOCK_STREAM, IPPROTO_SCTP); if (sd < 0) { LOG_E(MAC, "Socket creation error standalone PNF"); return -1; @@ -1061,11 +1062,13 @@ int ue_init_standalone_socket(const char *addr, int port) if (inet_pton(server_address.sin_family, addr, &server_address.sin_addr) <= 0) { LOG_E(MAC, "Invalid standalone PNF Address"); + close(sd); return -1; } - if (connect(socket, (struct sockaddr *)&server_address, addr_len) < 0) { + if (connect(sd, (struct sockaddr *)&server_address, addr_len) < 0) { LOG_E(MAC, "Connection to standalone PNF failed"); + close(sd); return -1; } diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 1b7208533c..ee751fe048 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -66,6 +66,7 @@ #include "LAYER2/MAC/mac_proto.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" +#include "PHY_INTERFACE/phy_stub_UE.h" #include "PHY/TOOLS/phy_scope_interface.h" #include "common/utils/LOG/log.h" #include "nfapi/oai_integration/vendor_ext.h"