fix arry size bug
This commit is contained in:
@@ -159,16 +159,8 @@ install_protobuf_from_source(){
|
||||
#cd protobuf-2.6.1/
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
else
|
||||
export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs
|
||||
rm -rf /tmp/protobuf
|
||||
git clone --depth=1 --branch=v3.3.0 https://github.com/protocolbuffers/protobuf.git /tmp/protobuf
|
||||
cd /tmp/protobuf
|
||||
git submodule update --init --recursive
|
||||
./autogen.sh
|
||||
fi
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner "$USER" --group "$(groups | cut -d" " -f1)" --no-same-owner
|
||||
cd protobuf-3.3.0/ || exit
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j"$(nproc)"
|
||||
@@ -339,6 +331,10 @@ check_install_ubuntu_packages() {
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"ubuntu20.04")
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
"ubuntu21.04")
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define sizeofArray(a) (sizeof(a)/sizeof(*(a)))
|
||||
void *calloc_or_fail(size_t size);
|
||||
void *malloc_or_fail(size_t size);
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
|
||||
mu = nrUE_config->prach_config.prach_sub_c_spacing;
|
||||
restricted_set = prach_pdu->restricted_set;
|
||||
rootSequenceIndex = prach_pdu->root_seq_id;
|
||||
fd_occasion = 0;
|
||||
n_ra_prb = nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,//prach_pdu->freq_msg1;
|
||||
NCS = prach_pdu->num_cs;
|
||||
prach_fmt_id = prach_pdu->prach_format;
|
||||
preamble_index = prach_resources->ra_PreambleIndex;
|
||||
fd_occasion = 0;
|
||||
prach_len = 0;
|
||||
dftlen = 0;
|
||||
first_nonzero_root_idx = 0;
|
||||
|
||||
@@ -549,7 +549,7 @@ static void deliver_sdu_srb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
int srb_id;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < sizeofArray(ue->srb) ; i++) {
|
||||
if (entity == ue->srb[i]) {
|
||||
srb_id = i+1;
|
||||
goto srb_found;
|
||||
@@ -592,7 +592,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
int i;
|
||||
mem_block_t *memblock;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < sizeofArray(ue->srb) ; i++) {
|
||||
if (entity == ue->srb[i]) {
|
||||
srb_id = i+1;
|
||||
goto srb_found;
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef void nr_pdcp_ue_manager_t;
|
||||
|
||||
typedef struct nr_pdcp_ue_t {
|
||||
int rnti;
|
||||
nr_pdcp_entity_t *srb[2];
|
||||
nr_pdcp_entity_t *srb[3];
|
||||
nr_pdcp_entity_t *drb[5];
|
||||
} nr_pdcp_ue_t;
|
||||
|
||||
|
||||
@@ -1026,7 +1026,14 @@ sctp_eNB_read_from_socket(
|
||||
break;
|
||||
|
||||
default:
|
||||
SCTP_WARN("unhandled: SCTP_ASSOC_CHANGE to %d\n", sctp_assoc_changed->sac_state);
|
||||
if ( sctp_assoc_changed->sac_state == SCTP_SHUTDOWN_COMP)
|
||||
SCTP_WARN("SCTP_ASSOC_CHANGE to SSCTP_SHUTDOWN_COMP\n");
|
||||
if ( sctp_assoc_changed->sac_state == SCTP_RESTART)
|
||||
SCTP_WARN("SCTP_ASSOC_CHANGE to SCTP_RESTART\n");
|
||||
if ( sctp_assoc_changed->sac_state == SCTP_CANT_STR_ASSOC)
|
||||
SCTP_ERROR("SCTP_ASSOC_CHANGE to SCTP_CANT_STR_ASSOC\n");
|
||||
if ( sctp_assoc_changed->sac_state == SCTP_COMM_LOST)
|
||||
SCTP_ERROR("SCTP_ASSOC_CHANGE to SCTP_COMM_LOST\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,12 +277,15 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r
|
||||
to.sin_family = AF_INET;
|
||||
to.sin_port = htons(tmp.outgoing_port);
|
||||
to.sin_addr.s_addr = tmp.outgoing_ip_addr;
|
||||
|
||||
char ip4[INET_ADDRSTRLEN];
|
||||
//char ip6[INET6_ADDRSTRLEN];
|
||||
LOG_D(GTPU,"sending end packet to %s\n", inet_ntoa(to.sin_addr) );
|
||||
|
||||
if (sendto(compatInst(instance), (void *)&msgHdr, sizeof(msgHdr), 0,(struct sockaddr *)&to, sizeof(to) ) != sizeof(msgHdr)) {
|
||||
LOG_E(GTPU,
|
||||
"[SD %ld] Failed to send data to " IPV4_ADDR " on port %d, buffer size %lu\n",
|
||||
compatInst(instance), IPV4_ADDR_FORMAT(tmp.outgoing_ip_addr), tmp.outgoing_port, sizeof(msgHdr));
|
||||
"[SD %ld] Failed to send data to %s on port %d, buffer size %lu\n",
|
||||
compatInst(instance), inet_ntop(AF_INET, &tmp.outgoing_ip_addr, ip4, INET_ADDRSTRLEN), tmp.outgoing_port, sizeof(msgHdr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user