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:
Michael Jerris 2009-05-19 20:25:59 +00:00
parent 1287948750
commit 85317633dc
4 changed files with 16 additions and 12 deletions

View File

@ -3486,15 +3486,17 @@ void sres_log_response(sres_resolver_t const *res,
if (from == NULL)
;
else if (from->ss_family == AF_INET) {
struct sockaddr_in const *sin = (void *)from;
su_inet_ntop(AF_INET, &sin->sin_addr, host, sizeof host);
port = sin->sin_port;
struct sockaddr_in sin;
memcpy(&sin, from, sizeof sin);
su_inet_ntop(AF_INET, &sin.sin_addr, host, sizeof host);
port = sin.sin_port;
}
#if HAVE_SIN6
else if (from->ss_family == AF_INET6) {
struct sockaddr_in6 const *sin6 = (void *)from;
su_inet_ntop(AF_INET6, &sin6->sin6_addr, host, sizeof host);
port = sin6->sin6_port;
struct sockaddr_in6 sin6;
memcpy(&sin6, from, sizeof sin6);
su_inet_ntop(AF_INET6, &sin6.sin6_addr, host, sizeof host);
port = sin6.sin6_port;
}
#endif

View File

@ -739,7 +739,7 @@ dns_socket dns_open(struct dns_ctx *ctx) {
sns = &ctx->dnsc_serv[i];
if (sns->sa.sa_family == AF_INET) {
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;
}
}

View File

@ -549,7 +549,8 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
case SWITCH_STUN_ATTR_MAPPED_ADDRESS:
if (attr->type) {
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);
}

View File

@ -1151,14 +1151,15 @@ SWITCH_DECLARE(int) switch_build_uri(char *uri,
int flags)
{
char host[NI_MAXHOST], serv[NI_MAXSERV];
struct sockaddr_storage ss;
struct sockaddr_in6 si6;
const struct sockaddr *addr;
const char *colon;
if (flags & SWITCH_URI_NO_SCOPE && sa->family == AF_INET6) {
memcpy(&ss, &sa->sa, sa->salen);
((struct sockaddr_in6*) (intptr_t) &ss)->sin6_scope_id = 0;
addr = (const struct sockaddr*) (intptr_t)&ss;
memcpy(&si6, &sa->sa, sa->salen);
si6.sin6_scope_id = 0;
addr = (const struct sockaddr*) &si6;
} else {
addr = (const struct sockaddr*) (intptr_t)&sa->sa;
}