Unverified Commit f5a0b4d2 authored by Elemer Lelik's avatar Elemer Lelik Committed by GitHub
Browse files

Merge pull request #1 from osmocom/pending

Use SO_REUSEADDR to quickly re-use addresses
parents 4b77edf6 1141acad
......@@ -1492,11 +1492,14 @@ void SCTPasp__PT_PROVIDER::map_delete_item_server(int index)
void SCTPasp__PT_PROVIDER::create_socket()
struct sockaddr_in sin;
int enable = 1;
log("Creating SCTP socket.");
if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) == -1)
error("Socket error: cannot create socket!");
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
if ( local_port_is_present ) {
sin.sin_family = AF_INET;
sin.sin_port = htons(local_port);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment