Skip to content

Commit

Permalink
Revert "Update network.c"
Browse files Browse the repository at this point in the history
This reverts commit 26fcb93.
this permit to compile on older kernel/network sources
  • Loading branch information
jblb committed Oct 24, 2014
1 parent f899b7b commit f71903d
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions artnet/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,13 @@ int artnet_net_start(node n) {
if (n->state.verbose)
printf("Binding to %s \n", inet_ntoa(servAddr.sin_addr));

// bind sockets
if (bind(sock, (SA *) &servAddr, sizeof(servAddr)) == -1) {
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
artnet_net_close(sock);
return ARTNET_ENET;
}

// allow bcasting
if (setsockopt(sock,
SOL_SOCKET,
Expand Down Expand Up @@ -541,30 +548,8 @@ int artnet_net_start(node n) {
artnet_net_close(sock);
return ARTNET_ENET;
}
#else
// allow reusing 6454 port _
if (setsockopt(sock,
SOL_SOCKET,
SO_REUSEPORT,
(char*) &true_flag, // char* for win32
sizeof(int)) == -1) {
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
artnet_net_close(sock);
return ARTNET_ENET;
}
#endif

if (n->state.verbose)
printf("Binding to %s \n", inet_ntoa(servAddr.sin_addr));

// bind sockets
if (bind(sock, (SA *) &servAddr, sizeof(servAddr)) == -1) {
artnet_error("Failed to bind to socket %s", artnet_net_last_error());
artnet_net_close(sock);
return ARTNET_ENET;
}


n->sd = sock;
// Propagate the socket to all our peers
for (tmp = n->peering.peer; tmp && tmp != n; tmp = tmp->peering.peer)
Expand Down

0 comments on commit f71903d

Please sign in to comment.