build: fix gcc-4.4.0 build failures (FSCORE-355)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13395 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1287948750
commit
85317633dc
|
@ -3486,15 +3486,17 @@ void sres_log_response(sres_resolver_t const *res,
|
||||||
if (from == NULL)
|
if (from == NULL)
|
||||||
;
|
;
|
||||||
else if (from->ss_family == AF_INET) {
|
else if (from->ss_family == AF_INET) {
|
||||||
struct sockaddr_in const *sin = (void *)from;
|
struct sockaddr_in sin;
|
||||||
su_inet_ntop(AF_INET, &sin->sin_addr, host, sizeof host);
|
memcpy(&sin, from, sizeof sin);
|
||||||
port = sin->sin_port;
|
su_inet_ntop(AF_INET, &sin.sin_addr, host, sizeof host);
|
||||||
|
port = sin.sin_port;
|
||||||
}
|
}
|
||||||
#if HAVE_SIN6
|
#if HAVE_SIN6
|
||||||
else if (from->ss_family == AF_INET6) {
|
else if (from->ss_family == AF_INET6) {
|
||||||
struct sockaddr_in6 const *sin6 = (void *)from;
|
struct sockaddr_in6 sin6;
|
||||||
su_inet_ntop(AF_INET6, &sin6->sin6_addr, host, sizeof host);
|
memcpy(&sin6, from, sizeof sin6);
|
||||||
port = sin6->sin6_port;
|
su_inet_ntop(AF_INET6, &sin6.sin6_addr, host, sizeof host);
|
||||||
|
port = sin6.sin6_port;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -739,7 +739,7 @@ dns_socket dns_open(struct dns_ctx *ctx) {
|
||||||
sns = &ctx->dnsc_serv[i];
|
sns = &ctx->dnsc_serv[i];
|
||||||
if (sns->sa.sa_family == AF_INET) {
|
if (sns->sa.sa_family == AF_INET) {
|
||||||
sin6.sin6_port = sns->sin.sin_port;
|
sin6.sin6_port = sns->sin.sin_port;
|
||||||
((struct in_addr*)&sin6.sin6_addr)[3] = sns->sin.sin_addr;
|
memcpy(&sin6.sin6_addr.s6_addr[12], &sns->sin.sin_addr, sizeof(struct in_addr));
|
||||||
sns->sin6 = sin6;
|
sns->sin6 = sin6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,7 +549,8 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
|
||||||
case SWITCH_STUN_ATTR_MAPPED_ADDRESS:
|
case SWITCH_STUN_ATTR_MAPPED_ADDRESS:
|
||||||
if (attr->type) {
|
if (attr->type) {
|
||||||
if (funny) {
|
if (funny) {
|
||||||
((switch_stun_ip_t *) attr->value)->address ^= ntohl(0xabcdabcd);
|
switch_stun_ip_t *tmp = (switch_stun_ip_t *)attr->value;
|
||||||
|
tmp->address ^= ntohl(0xabcdabcd);
|
||||||
}
|
}
|
||||||
switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport);
|
switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1151,14 +1151,15 @@ SWITCH_DECLARE(int) switch_build_uri(char *uri,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
char host[NI_MAXHOST], serv[NI_MAXSERV];
|
char host[NI_MAXHOST], serv[NI_MAXSERV];
|
||||||
struct sockaddr_storage ss;
|
struct sockaddr_in6 si6;
|
||||||
const struct sockaddr *addr;
|
const struct sockaddr *addr;
|
||||||
const char *colon;
|
const char *colon;
|
||||||
|
|
||||||
if (flags & SWITCH_URI_NO_SCOPE && sa->family == AF_INET6) {
|
if (flags & SWITCH_URI_NO_SCOPE && sa->family == AF_INET6) {
|
||||||
memcpy(&ss, &sa->sa, sa->salen);
|
memcpy(&si6, &sa->sa, sa->salen);
|
||||||
((struct sockaddr_in6*) (intptr_t) &ss)->sin6_scope_id = 0;
|
si6.sin6_scope_id = 0;
|
||||||
addr = (const struct sockaddr*) (intptr_t)&ss;
|
|
||||||
|
addr = (const struct sockaddr*) &si6;
|
||||||
} else {
|
} else {
|
||||||
addr = (const struct sockaddr*) (intptr_t)&sa->sa;
|
addr = (const struct sockaddr*) (intptr_t)&sa->sa;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue