Commit 6e13ef49 authored by Simon Morlat's avatar Simon Morlat

Fix issue with selected random port not being written in session->rtp.gs.loc_addr.

parent a88be02b
Pipeline #159 canceled with stage
in 0 seconds
......@@ -253,8 +253,6 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami
set_multicast_group(sock, addr);
break;
}
memcpy(bound_addr,res0->ai_addr,res0->ai_addrlen);
*bound_addr_len=(socklen_t)res0->ai_addrlen;
bctbx_freeaddrinfo(res0);
......@@ -279,6 +277,9 @@ static ortp_socket_t create_and_bind(const char *addr, int *port, int *sock_fami
close_socket(sock);
return (ortp_socket_t)-1;
}
/*update the bind address, especially useful if requested port was 0 (random)*/
memcpy(bound_addr,&saddr,slen);
*bound_addr_len=slen;
err = bctbx_sockaddr_to_ip_address((struct sockaddr *)&saddr, slen, NULL, 0, port);
if (err!=0){
close_socket(sock);
......
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