From: <sri...@us...> - 2009-07-28 10:16:21
|
Revision: 586 http://sipp.svn.sourceforge.net/sipp/?rev=586&view=rev Author: srivanuj Date: 2009-07-28 10:16:12 +0000 (Tue, 28 Jul 2009) Log Message: ----------- Fix:For IPV6, command line param was ignored, and corrrections for PCAP play - Provider , Mitko-mitev. Modified Paths: -------------- sipp/trunk/call.cpp sipp/trunk/sipp.cpp Modified: sipp/trunk/call.cpp =================================================================== --- sipp/trunk/call.cpp 2009-06-30 12:02:56 UTC (rev 585) +++ sipp/trunk/call.cpp 2009-07-28 10:16:12 UTC (rev 586) @@ -151,13 +151,13 @@ * Look for "c=IN IP6 " pattern in the message and extract the following value * which should be IPv6 address */ -uint8_t get_remote_ipv6_media(char *msg, struct in6_addr addr) +uint8_t get_remote_ipv6_media(char *msg, struct in6_addr *addr) { char pattern[] = "c=IN IP6 "; char *begin, *end; char ip[128]; - memset(&addr, 0, sizeof(addr)); + memset(addr, 0, sizeof(*addr)); memset(ip, 0, 128); begin = strstr(msg, pattern); @@ -170,7 +170,7 @@ if (!end) return 0; strncpy(ip, begin, end - begin); - if (!inet_pton(AF_INET6, ip, &addr)) { + if (!inet_pton(AF_INET6, ip, addr)) { return 0; } return 1; @@ -217,7 +217,7 @@ uint16_t video_port, audio_port; if (media_ip_is_ipv6) { struct in6_addr ip_media; - if (get_remote_ipv6_media(msg, ip_media)) { + if (get_remote_ipv6_media(msg, &ip_media)) { audio_port = get_remote_port_media(msg, PAT_AUDIO); if (audio_port) { /* We have audio in the SDP: set the to_audio addr */ Modified: sipp/trunk/sipp.cpp =================================================================== --- sipp/trunk/sipp.cpp 2009-06-30 12:02:56 UTC (rev 585) +++ sipp/trunk/sipp.cpp 2009-07-28 10:16:12 UTC (rev 586) @@ -4937,7 +4937,10 @@ ERROR("Unknown RTP address '%s'.\n" "Use 'sipp -h' for details", media_ip); } - + + memset(&media_sockaddr,0,sizeof(struct sockaddr_storage)); + media_sockaddr.ss_family = local_addr->ai_addr->sa_family; + memcpy(&media_sockaddr, local_addr->ai_addr, SOCK_ADDR_SIZE( @@ -5203,12 +5206,10 @@ get_inet_address( _RCAST(struct sockaddr_storage *, local_addr->ai_addr))); } else { - if (!(local_sockaddr.ss_family == AF_INET6)) { - memcpy(&local_sockaddr, - local_addr->ai_addr, - SOCK_ADDR_SIZE( - _RCAST(struct sockaddr_storage *,local_addr->ai_addr))); - } + memcpy(&local_sockaddr, + local_addr->ai_addr, + SOCK_ADDR_SIZE( + _RCAST(struct sockaddr_storage *,local_addr->ai_addr))); } freeaddrinfo(local_addr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |