summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
aa35a8e)
When DU simulator is run locally, the function crashes due to segfault
inside `nf_oran_du_init` when trying to read `ves_template.json` file.
This is because `ves_template.json` file is not copied during the image
creation.
Also, the actual utility function `file_read_content` instead of
returning a `NULL` crashes, because uninitialized `length` was used to
assign a value when `buffer` was `NULL`. Fixed this as well, the
`buffer[length]` value is only sent if the file exists and a valid
buffer is allocated.
Issue-Id: SIM-109
Change-Id: I75eb985f479331850de2e9fc4aac2ca588fa133c
Signed-off-by: Abhijit Gadgil <gabhijit@iitbombay.org>
COPY ./yang /opt/dev/deploy/yang
COPY ./data /opt/dev/deploy/data
COPY ./config.json /opt/dev/ntsim-ng/config/config.json
COPY ./yang /opt/dev/deploy/yang
COPY ./data /opt/dev/deploy/data
COPY ./config.json /opt/dev/ntsim-ng/config/config.json
-COPY ./config.json /opt/dev/ntsim-ng/config/config.json
-
+COPY ./ves_template.json /opt/dev/ntsim-ng/config/ves_template.json
# ntsim-ng init docker
RUN /opt/dev/ntsim-ng/ntsim-ng --container-init -w /opt/dev/ntsim-ng
# ntsim-ng init docker
RUN /opt/dev/ntsim-ng/ntsim-ng --container-init -w /opt/dev/ntsim-ng
buffer = (char*)malloc(sizeof(char) * (length + 1));
if(buffer) {
fread(buffer, 1, length, f);
buffer = (char*)malloc(sizeof(char) * (length + 1));
if(buffer) {
fread(buffer, 1, length, f);
ret = false;
goto get_local_ips_free;
}
ret = false;
goto get_local_ips_free;
}
*ipv4 = strdup(host);
break;
}
*ipv4 = strdup(host);
break;
}
ret = false;
goto get_local_ips_free;
}
ret = false;
goto get_local_ips_free;
}
*ipv6 = strdup(host);
break;
}
*ipv6 = strdup(host);
break;
}
assert(host);
int simpleSocket = 0;
assert(host);
int simpleSocket = 0;
struct addrinfo simpleServer;
struct addrinfo *res;
struct addrinfo simpleServer;
struct addrinfo *res;
char s[INET6_ADDRSTRLEN];
switch(res->ai_addr->sa_family) {
case AF_INET: {
char s[INET6_ADDRSTRLEN];
switch(res->ai_addr->sa_family) {
case AF_INET: {
- struct sockaddr_in *addr_in = (struct sockaddr_in *)res->ai_addr;
+ struct sockaddr_in *addr_in = (struct sockaddr_in *)res->ai_addr;
inet_ntop(AF_INET, &(addr_in->sin_addr), s, INET_ADDRSTRLEN);
returnStatus = connect(simpleSocket, res->ai_addr, res->ai_addrlen);
break;
inet_ntop(AF_INET, &(addr_in->sin_addr), s, INET_ADDRSTRLEN);
returnStatus = connect(simpleSocket, res->ai_addr, res->ai_addrlen);
break;
freeaddrinfo(res);
close(simpleSocket);
freeaddrinfo(res);
close(simpleSocket);
- if(returnStatus == 0) {
+ if(returnStatus == 0) {
free(line);
line = 0;
len = 0;
free(line);
line = 0;
len = 0;