add error handling on binding s1c socket (#267)

master
Igor Kim 6 years ago committed by Andre Puschmann
parent 46d41a5dc5
commit 9def82d15b

@ -283,7 +283,10 @@ bool s1ap::connect_mme()
s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str()); s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str());
return false; return false;
} }
bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)); if (bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)) != 0) {
s1ap_log->error("Failed to bind on S1-C address %s: %s errno %d\n", args.s1c_bind_addr.c_str(), strerror(errno), errno);
return false;
}
// Connect to the MME address // Connect to the MME address
memset(&mme_addr, 0, sizeof(struct sockaddr_in)); memset(&mme_addr, 0, sizeof(struct sockaddr_in));

Loading…
Cancel
Save