Commit 7d6d05cd authored by Simon Morlat's avatar Simon Morlat

allow RTP socket to work with AI_V4MAPPED ipv6 address

parent fcc51caa
......@@ -26,4 +26,5 @@ lt*.m4
libtool.m4
doc
ortp.defs
INSTALL
stamp-h1
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
......@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
......
......@@ -70,6 +70,12 @@ typedef WSACMSGHDR *LPWSACMSGHDR;
#define CMSG_DATA WSA_CMSG_DATA
typedef INT (WINAPI * LPFN_WSARECVMSG)(SOCKET, LPWSAMSG, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE);
static LPFN_WSARECVMSG ortp_WSARecvMsg = NULL;
/*Mingw32 does not define AI_V4MAPPED, however it is supported starting from Windows Vista.*/
# ifndef AI_V4MAPPED
# define AI_V4MAPPED 0x00000800
# endif
#endif
static bool_t try_connect(int fd, const struct sockaddr *dest, socklen_t addrlen){
......@@ -763,9 +769,12 @@ rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_addr, i
#ifdef ORTP_INET6
struct addrinfo hints, *res0, *res;
char num[8];
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_family = (session->rtp.socket == -1) ? AF_UNSPEC : session->rtp.sockfamily;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = hints.ai_family==AF_INET6 ? AI_V4MAPPED : 0;
snprintf(num, sizeof(num), "%d", rtp_port);
err = getaddrinfo(rtp_addr, num, &hints, &res0);
if (err) {
......@@ -805,8 +814,9 @@ rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_addr, i
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_family = (session->rtp.socket == -1) ? AF_UNSPEC : session->rtp.sockfamily;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = hints.ai_family==AF_INET6 ? AI_V4MAPPED : 0;
snprintf(num, sizeof(num), "%d", rtcp_port);
err = getaddrinfo(rtcp_addr, num, &hints, &res0);
if (err) {
......@@ -878,8 +888,7 @@ rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_addr, i
return 0;
}
int
rtp_session_set_remote_addr_and_port(RtpSession * session, const char * addr, int rtp_port, int rtcp_port){
int rtp_session_set_remote_addr_and_port(RtpSession * session, const char * addr, int rtp_port, int rtcp_port){
return rtp_session_set_remote_addr_full(session,addr,rtp_port,addr,rtcp_port);
}
......
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