From: Automerge Script Date: Wed, 11 Apr 2007 15:56:57 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.18-netsec~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c2c0004a8763267f41fc22b7abb1353bd3e5f6b;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@61475 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 984dd947f7..3f88344595 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12525,7 +12525,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int if (peer) { /* Already in the list, remove it and it will be added back (or FREE'd) */ - found++; + found = 1; } else { peer = malloc(sizeof(*peer)); if (peer) { @@ -12624,10 +12624,9 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int ast_log(LOG_WARNING, "You can't have a dynamic outbound proxy, you big silly head at line %d.\n", v->lineno); } else { /* They'll register with us */ - ast_set_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC); - if (!found) { - /* Initialize stuff iff we're not found, otherwise - we keep going with what we had */ + if (!found || !ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)) { + /* Initialize stuff if this is a new peer, or if it used to be + * non-dynamic before the reload. */ memset(&peer->addr.sin_addr, 0, 4); if (peer->addr.sin_port) { /* If we've already got a port, make it the default rather than absolute */ @@ -12635,6 +12634,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int peer->addr.sin_port = 0; } } + ast_set_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC); } } else { /* Non-dynamic. Make sure we become that way if we're not */