[svn-commits] mmichelson: trunk r279786 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 27 10:16:49 CDT 2010


Author: mmichelson
Date: Tue Jul 27 10:16:45 2010
New Revision: 279786

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=279786
Log:
Merged revisions 279785 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r279785 | mmichelson | 2010-07-27 10:15:22 -0500 (Tue, 27 Jul 2010) | 20 lines
  
  Merged revisions 279784 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r279784 | mmichelson | 2010-07-27 10:13:24 -0500 (Tue, 27 Jul 2010) | 14 lines
    
    Fix bad behavior of dynamic_exclude_static option in sip.conf.
    
    We were attempting to create a contactdeny rule based on the peer's
    IP address before the peer's IP address had been set. By moving the
    processing further down in the function, we can ensure stuff works
    as we expect for it to.
    
    (closes issue #17717)
    Reported by: mmichelson
    Patches: 
          17717.patch uploaded by mmichelson (license 60)
    Tested by: DennisD
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.8-merged (original)
+++ branch-1.8-merged Tue Jul 27 10:16:45 2010
@@ -1,1 +1,1 @@
-/branches/1.8:1-279056,279113,279227,279273,279280,279314,279390,279410,279442,279472,279502,279504,279562,279566,279568,279598,279601,279619,279658,279689,279726,279755
+/branches/1.8:1-279056,279113,279227,279273,279280,279314,279390,279410,279442,279472,279502,279504,279562,279566,279568,279598,279601,279619,279658,279689,279726,279755,279785

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=279786&r1=279785&r2=279786
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Jul 27 10:16:45 2010
@@ -25596,14 +25596,6 @@
 							unref_peer(peer, "removing register expire ref"));
 					peer->host_dynamic = FALSE;
 					srvlookup = v->value;
-					if (global_dynamic_exclude_static) {
-						int err = 0;
-						sip_cfg.contact_ha = ast_append_ha("deny", ast_sockaddr_stringify(&peer->addr), 
-										sip_cfg.contact_ha, &err);
-						if (err) {
-							ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
-						}
-					}
 				}
 			} else if (!strcasecmp(v->name, "defaultip")) {
 				if (!ast_strlen_zero(v->value) && ast_get_ip(&peer->defaddr, v->value)) {
@@ -25950,6 +25942,15 @@
 
 		ast_string_field_set(peer, tohost, peer->dnsmgr ? srvlookup :
 				     ast_sockaddr_stringify_host(&peer->addr));
+		
+		if (global_dynamic_exclude_static) {
+			int err = 0;
+			sip_cfg.contact_ha = ast_append_ha("deny", ast_sockaddr_stringify_addr(&peer->addr), 
+							sip_cfg.contact_ha, &err);
+			if (err) {
+				ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
+			}
+		}
 	}
 
 	if (port && !realtime && peer->host_dynamic) {




More information about the svn-commits mailing list