[raop] Fix possible incorrect address family in SDP

This commit is contained in:
ejurgensen
2017-05-04 19:31:26 +02:00
parent 544791ef59
commit f465f6a77d
3 changed files with 23 additions and 14 deletions

View File

@@ -142,10 +142,10 @@ void evrtsp_connection_set_base(struct evrtsp_connection *evcon,
void evrtsp_connection_get_peer(struct evrtsp_connection *evcon,
char **address, u_short *port);
/** Get the local address and port associated with this connection. */
/** Get the local address, port and family associated with this connection. */
void
evrtsp_connection_get_local_address(struct evrtsp_connection *evcon,
char **address, u_short *port);
char **address, u_short *port, int *family);
/** The connection gets ownership of the request */
int evrtsp_make_request(struct evrtsp_connection *evcon,

View File

@@ -1300,7 +1300,7 @@ evrtsp_connection_set_closecb(struct evrtsp_connection *evcon,
void
evrtsp_connection_get_local_address(struct evrtsp_connection *evcon,
char **address, u_short *port)
char **address, u_short *port, int *family)
{
union {
struct sockaddr_storage ss;
@@ -1327,7 +1327,9 @@ evrtsp_connection_get_local_address(struct evrtsp_connection *evcon,
if (!*address)
return;
switch (addr.ss.ss_family)
*family = addr.ss.ss_family;
switch (*family)
{
case AF_INET:
*port = ntohs(addr.sin.sin_port);