chan_sip: Use AST_AF* defined constant when calling ast_get_ip
authorMatthew Jordan <mjordan@digium.com>
Tue, 5 Nov 2013 21:17:30 +0000 (21:17 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 5 Nov 2013 21:17:30 +0000 (21:17 +0000)
While the structure passed to ast_get_ip should be set memset to 0, thus
initializing the ss_family member to 0, explicitly setting it to AST_AF_UNSPEC
is more portable.
........

Merged revisions 402507 from http://svn.asterisk.org/svn/asterisk/branches/12

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

channels/chan_sip.c

index d143dc1..3b21d9f 100644 (file)
@@ -30731,6 +30731,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
                                        srvlookup = v->value;
                                }
                        } else if (!strcasecmp(v->name, "defaultip")) {
+                               peer->defaddr.ss.ss_family = AST_AF_UNSPEC;
                                if (!ast_strlen_zero(v->value) && ast_get_ip(&peer->defaddr, v->value)) {
                                        sip_unref_peer(peer, "sip_unref_peer: from build_peer defaultip");
                                        return NULL;