- Forgot to check in these files.

master
Asim Jamshed 2017-03-05 01:23:46 +09:00
parent 94b230dfb1
commit 14c4652e18
3 changed files with 7 additions and 2 deletions

View File

@ -232,7 +232,10 @@ ParseMACAddress(unsigned char *haddr, char *haddr_str)
TRACE_CONFIG("MAC address length exceeds %d!\n", ETH_ALEN);
exit(4);
}
sscanf(str, "%x", &temp);
if (sscanf(str, "%x", &temp) < 1) {
TRACE_CONFIG("sscanf failed!\n");
exit(4);
}
haddr[i++] = temp;
str = strtok_r(NULL, ":", &saveptr);
}

View File

@ -891,7 +891,7 @@ InitializeMTCPManager(struct mtcp_thread_context* ctx)
mtcp = (mtcp_manager_t)calloc(1, sizeof(struct mtcp_manager));
if (!mtcp) {
perror("malloc");
CTRACE_ERROR("Failed to allocate mtcp_manager.\n");
fprintf(stderr, "Failed to allocate mtcp_manager.\n");
return NULL;
}
g_mtcp[ctx->cpu] = mtcp;

View File

@ -241,6 +241,7 @@ SetInterfaceInfo(char* dev_name_list)
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (sock == -1) {
perror("socket");
exit(EXIT_FAILURE);
}
/* getting address */
@ -317,6 +318,7 @@ SetInterfaceInfo(char* dev_name_list)
int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP);
if (sock == -1) {
perror("socket");
exit(EXIT_FAILURE);
}
/* getting address */