Merged revisions 113012 via svnmerge from
[asterisk/asterisk.git] / channels / chan_sip.c
index ff8abb6..3cc98d5 100644 (file)
@@ -3610,7 +3610,7 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct sockaddr_i
                         */
                        if (var) {
                                for (tmp = var; tmp; tmp = tmp->next) {
-                                       if (!strcasecmp(tmp->name, "host")) {
+                                       if (!strcasecmp(var->name, "host")) {
                                                struct hostent *hp;
                                                struct ast_hostent ahp;
                                                if (!(hp = ast_gethostbyname(tmp->value, &ahp)) || (memcmp(&hp->h_addr, &sin->sin_addr, sizeof(hp->h_addr)))) {