From 9d6a58fc58bec99c9662f5daeb98dde26d7c2101 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 27 Jan 2014 09:41:48 -0500 Subject: [PATCH] Backed out changeset ce887b471785 (bug 961313) for buffered_stun_socket_unittest crashes, again. --- .../third_party/nICEr/src/net/transport_addr.c | 16 ++-------------- .../third_party/nICEr/src/net/transport_addr.h | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/media/mtransport/third_party/nICEr/src/net/transport_addr.c b/media/mtransport/third_party/nICEr/src/net/transport_addr.c index 10498b2e12b7..d2a364131df0 100644 --- a/media/mtransport/third_party/nICEr/src/net/transport_addr.c +++ b/media/mtransport/third_party/nICEr/src/net/transport_addr.c @@ -57,29 +57,17 @@ int nr_transport_addr_fmt_addr_string(nr_transport_addr *addr) int _status; /* Max length for normalized IPv6 address string represntation is 39 */ char buffer[40]; - const char *protocol; - - switch(addr->protocol){ - case IPPROTO_TCP: - protocol = "TCP"; - break; - case IPPROTO_UDP: - protocol = "UDP"; - break; - default: - ABORT(R_INTERNAL); - } switch(addr->ip_version){ case NR_IPV4: if (!inet_ntop(AF_INET, &addr->u.addr4.sin_addr,buffer,sizeof(buffer))) strcpy(buffer, "[error]"); - snprintf(addr->as_string,sizeof(addr->as_string),"IP4:%s:%d/%s",buffer,ntohs(addr->u.addr4.sin_port),protocol); + snprintf(addr->as_string,sizeof(addr->as_string),"IP4:%s:%d",buffer,ntohs(addr->u.addr4.sin_port)); break; case NR_IPV6: if (!inet_ntop(AF_INET6, &addr->u.addr6.sin6_addr,buffer,sizeof(buffer))) strcpy(buffer, "[error]"); - snprintf(addr->as_string,sizeof(addr->as_string),"IP6:[%s]:%d/%s",buffer,ntohs(addr->u.addr6.sin6_port),protocol); + snprintf(addr->as_string,sizeof(addr->as_string),"IP6:[%s]:%d",buffer,ntohs(addr->u.addr6.sin6_port)); break; default: ABORT(R_INTERNAL); diff --git a/media/mtransport/third_party/nICEr/src/net/transport_addr.h b/media/mtransport/third_party/nICEr/src/net/transport_addr.h index 6ae014b80b93..9bf6504f606c 100644 --- a/media/mtransport/third_party/nICEr/src/net/transport_addr.h +++ b/media/mtransport/third_party/nICEr/src/net/transport_addr.h @@ -67,8 +67,8 @@ typedef struct nr_transport_addr_ { } u; char ifname[MAXIFNAME]; /* A string version. - 56 = 5 ("IP6:[") + 39 (ipv6 address) + 2 ("]:") + 5 (port) + 4 (/UDP) + 1 (null) */ - char as_string[56]; + 52 = 5 ("IP6:[") + 39 (ipv6 address) + 2 ("]:") + 5 (port) + 1 (null) */ + char as_string[52]; } nr_transport_addr; int nr_sockaddr_to_transport_addr(struct sockaddr *saddr, int saddr_len, int protocol, int keep, nr_transport_addr *addr);