[svn-commits] mnicholson: branch group/v6-new r270978 - in /team/group/v6-new: ./ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 16 16:08:05 CDT 2010


Author: mnicholson
Date: Wed Jun 16 16:08:02 2010
New Revision: 270978

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=270978
Log:
merged r270974 from trunk

Modified:
    team/group/v6-new/   (props changed)
    team/group/v6-new/main/dnsmgr.c

Propchange: team/group/v6-new/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 16 16:08:02 2010
@@ -1,1 +1,2 @@
 /be/branches/C.3:256426
+/trunk:270974

Modified: team/group/v6-new/main/dnsmgr.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/main/dnsmgr.c?view=diff&rev=270978&r1=270977&r2=270978
==============================================================================
--- team/group/v6-new/main/dnsmgr.c (original)
+++ team/group/v6-new/main/dnsmgr.c Wed Jun 16 16:08:02 2010
@@ -52,8 +52,6 @@
 struct ast_dnsmgr_entry {
 	/*! where we will store the resulting IP address and port number */
 	struct ast_sockaddr *result;
-	/*! the last result, used to check if address/port has changed */
-	struct ast_sockaddr last;
 	/*! SRV record to lookup, if provided. Composed of service, protocol, and domain name: _Service._Proto.Name */
 	char *service;
 	/*! Set to 1 if the entry changes */
@@ -96,7 +94,6 @@
 	entry->result = result;
 	ast_mutex_init(&entry->lock);
 	strcpy(entry->name, name);
-	ast_sockaddr_copy(&entry->last, result);
 	if (service) {
 		entry->service = ((char *) entry) + sizeof(*entry) + strlen(name);
 		strcpy(entry->service, service);
@@ -162,15 +159,16 @@
 	if (verbose)
 		ast_verb(3, "refreshing '%s'\n", entry->name);
 
+	memset(&tmp, 0, sizeof(tmp));
+
 	if (!ast_get_ip_or_srv(&tmp, entry->name, entry->service)) {
-		ast_sockaddr_set_port(&tmp, ast_sockaddr_port(&entry->last));
-		if(ast_sockaddr_cmp(&tmp, &entry->last)) {
+		ast_sockaddr_set_port(&tmp, ast_sockaddr_port(entry->result));
+		if(ast_sockaddr_cmp(&tmp, entry->result)) {
 			ast_log(LOG_NOTICE, "dnssrv: host '%s' changed from %s to %s\n",
-					entry->name, ast_sockaddr_stringify(&entry->last),
+					entry->name, ast_sockaddr_stringify(entry->result),
 					ast_sockaddr_stringify(&tmp));
 
 			ast_sockaddr_copy(entry->result, &tmp);
-			ast_sockaddr_copy(&entry->last, &tmp);
 			changed = entry->changed = 1;
 		}
 	}




More information about the svn-commits mailing list