Skip to content
Snippets Groups Projects

Issue_181 and Issue_179

Merged Matthew Edge requested to merge edgehew/librist:librist-issue_181 into master
Files
2
+ 5
13
@@ -312,23 +312,15 @@ int udpsocket_open_bind(const char *host, uint16_t port, const char *mciface)
/* Non-critical error */
rist_log_priv3( RIST_LOG_ERROR, "Cannot set SO_REUSEADDR: %s\n", strerror(errno));
}
if (is_multicast) {
struct sockaddr_in6 sa = { .sin6_family = raw.sin6_family, .sin6_port = raw.sin6_port };
if (bind(sd, (struct sockaddr *)&sa, addrlen) < 0) {
rist_log_priv3(RIST_LOG_ERROR, "Could not bind to interface: %s\n", strerror(errno));
udpsocket_close(sd);
return -1;
}
if (udpsocket_join_mcast_group(sd, mciface, (struct sockaddr *)&raw, raw.sin6_family) != 0) {
rist_log_priv3( RIST_LOG_ERROR, "Could not join multicast group: %s on %s\n", host, mciface);
return -1;
}
} else if (bind(sd, (struct sockaddr *)&raw, addrlen) < 0) {
if (bind(sd, (struct sockaddr *)&raw, addrlen) < 0) {
rist_log_priv3( RIST_LOG_ERROR, "Could not bind to interface: %s\n", strerror(errno));
udpsocket_close(sd);
return -1;
}
if (is_multicast && udpsocket_join_mcast_group(sd, mciface, (struct sockaddr *)&raw, raw.sin6_family) != 0) {
rist_log_priv3( RIST_LOG_ERROR, "Could not join multicast group: %s on %s\n", host, mciface);
return -1;
}
return sd;
}
Loading