mirror of
https://github.com/meetecho/janus-gateway.git
synced 2025-04-20 18:37:31 +08:00
Do the same for VideoRoom remote publishers
This commit is contained in:
parent
22abdc2a31
commit
a231fbcefa
@ -13602,7 +13602,8 @@ static int janus_videoroom_create_fd(int port, in_addr_t mcast, const janus_netw
|
||||
|
||||
int fd = -1, family = 0;
|
||||
while(1) {
|
||||
family = 0; /* By default, we bind to both IPv4 and IPv6 */
|
||||
/* By default, we bind to both IPv4 and IPv6, unless IPv6 is disabled */
|
||||
family = ipv6_disabled ? AF_INET : 0;
|
||||
if(use_range && rtp_port_wrap && rtp_port_next >= rtp_port_start) {
|
||||
/* Full range scanned */
|
||||
JANUS_LOG(LOG_ERR, "No ports available for RTP/RTCP in range: %u -- %u\n",
|
||||
@ -13695,6 +13696,12 @@ static int janus_videoroom_create_fd(int port, in_addr_t mcast, const janus_netw
|
||||
if(host && hostlen > 0)
|
||||
g_strlcpy(host, janus_network_address_string_from_buffer(&address_representation), hostlen);
|
||||
} else if(iface->family == AF_INET6) {
|
||||
if(ipv6_disabled) {
|
||||
JANUS_LOG(LOG_ERR, "Can't bind remote publisher to IPv6 address, IPv6 is disabled\n");
|
||||
close(fd);
|
||||
janus_mutex_unlock(&fd_mutex);
|
||||
return -1;
|
||||
}
|
||||
memcpy(&address6.sin6_addr, &iface->ipv6, sizeof(iface->ipv6));
|
||||
(void) janus_network_address_to_string_buffer(iface, &address_representation); /* This is OK: if we get here iface must be non-NULL */
|
||||
JANUS_LOG(LOG_VERB, "Remote publisher restricted to interface address: %s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user