Merged revisions 101482 via svnmerge from
authorJason Parker <jparker@digium.com>
Thu, 31 Jan 2008 19:54:46 +0000 (19:54 +0000)
committerJason Parker <jparker@digium.com>
Thu, 31 Jan 2008 19:54:46 +0000 (19:54 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101482 | qwell | 2008-01-31 13:52:49 -0600 (Thu, 31 Jan 2008) | 4 lines

Solaris compat fixes for struct in_addr funkiness.

Issue #11885, patch by snuffy.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101483 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c
channels/chan_sip.c

index faa8337..221219b 100644 (file)
@@ -2956,8 +2956,9 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in
                if (var && sin) {
                        for (tmp = var; tmp; tmp = tmp->next) {
                                if (!strcasecmp(tmp->name, "host")) {
-                                       struct in_addr sin2 = { 0, };
+                                       struct in_addr sin2;
                                        struct ast_dnsmgr_entry *dnsmgr = NULL;
+                                       memset(&sin2, 0, sizeof(sin2));
                                        if ((ast_dnsmgr_lookup(tmp->value, &sin2, &dnsmgr) < 0) || (memcmp(&sin2, &sin->sin_addr, sizeof(sin2)) != 0)) {
                                                /* No match */
                                                ast_variables_destroy(var);
@@ -3068,8 +3069,9 @@ static struct iax2_user *realtime_user(const char *username, struct sockaddr_in
                if (var) {
                        for (tmp = var; tmp; tmp = tmp->next) {
                                if (!strcasecmp(tmp->name, "host")) {
-                                       struct in_addr sin2 = { 0, };
+                                       struct in_addr sin2;
                                        struct ast_dnsmgr_entry *dnsmgr = NULL;
+                                       memset(&sin2, 0, sizeof(sin2));
                                        if ((ast_dnsmgr_lookup(tmp->value, &sin2, &dnsmgr) < 0) || (memcmp(&sin2, &sin->sin_addr, sizeof(sin2)) != 0)) {
                                                /* No match */
                                                ast_variables_destroy(var);
index 5b8b087..041ddaa 100644 (file)
@@ -3499,8 +3499,9 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct sockaddr_i
                        if (var) {
                                for (tmp = var; tmp; tmp = tmp->next) {
                                        if (!strcasecmp(var->name, "host")) {
-                                               struct in_addr sin2 = { 0, };
+                                               struct in_addr sin2;
                                                struct ast_dnsmgr_entry *dnsmgr = NULL;
+                                               memset(&sin2, 0, sizeof(sin2));
                                                if ((ast_dnsmgr_lookup(tmp->value, &sin2, &dnsmgr) < 0) || (memcmp(&sin2, &sin->sin_addr, sizeof(sin2)) != 0)) {
                                                        /* No match */
                                                        ast_variables_destroy(var);