PERFORCE change 124970 for review

Fredrik Lindberg fli at FreeBSD.org
Thu Aug 9 12:17:33 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=124970

Change 124970 by fli at fli_nexus on 2007/08/09 19:17:18

	- Follow changes done to the record database.
	- Use unsigned int on variables that hold interface indices.

Affected files ...

.. //depot/projects/soc2007/fli-mdns_sd/mdnsd/mdnsd.c#6 edit

Differences ...

==== //depot/projects/soc2007/fli-mdns_sd/mdnsd/mdnsd.c#6 (text+ko) ====

@@ -287,7 +287,7 @@
 
 	mrs = mdns_pkg_getrrset();
 	record2rrset(r, rt, rr, mrs, 0);
-	mrs->r_ttl = ds->ds_ttl;
+	mrs->r_ttl = ds->ds_dir->dir_ttl;
 	clock_gettime(CLOCK_REALTIME, &ds->ds_time);
 	mdns_pkg_addanswer(pc, mrs, 0);
 }
@@ -363,10 +363,10 @@
 		if (ds != NULL && !(ds->ds_flags & DS_INVALID)) {
 			rr = &ds->ds_res;
 			if (aq_inqueue(aq, rr)) {
-				if (rs.r_ttl > ds->ds_ttl / 2)
+				if (rs.r_ttl > ds->ds_dir->dir_ttl / 2)
 					aq_dequeue(aq, rr);
 			}
-			else if (rs.r_ttl > ds->ds_ttl / 2) {
+			else if (rs.r_ttl > ds->ds_dir->dir_ttl / 2) {
 				error = cache_add(&ac, &rs, NULL);
 				if (error == 1)
 					free(rs.r_data);
@@ -483,7 +483,8 @@
 				if (legacy || qs.q_unicast) {
 					rsp = mdns_pkg_getrrset();
 					record2rrset(r, rt, rr, rsp, 0);
-					rsp->r_ttl = legacy ? 10 : ds->ds_ttl;
+					rsp->r_ttl = legacy ? 10 :
+					    ds->ds_dir->dir_ttl;
 					mdns_pkg_addanswer(&upc, rsp, 0);
 					send_unicast = 1;
 					/*
@@ -493,7 +494,7 @@
 					 * its ttl.
 					 */	
 					if ((ts.tv_sec - ds->ds_time.tv_sec) >
-					    (int32_t)(ds->ds_ttl / 4))
+					    (int32_t)(ds->ds_dir->dir_ttl / 4))
 						aq_enqueue(aq, rr, min, max);
 				}
 				/*
@@ -544,7 +545,8 @@
 
 		dr = dbr_find(&mif->mif_dbr, rs.r_name);
 		if (dr != NULL && !(dr->dr_flags & DR_SHARED)) {
-			dprintf(DEBUG_SEND, "Conflicting name %s", rs.r_name);
+			dprintf(DEBUG_SEND, "Conflicting name %s (dr=%x)",
+			    rs.r_name, dr);
 			dbr_defend(&mif->mif_dbr, dr, &rs, from->sa_family);
 			continue;
 		}
@@ -1121,7 +1123,7 @@
 }
 
 static struct md_if *
-if_indextodata(struct md_glob *g, int idx)
+if_indextodata(struct md_glob *g, unsigned int idx)
 {
 	struct md_if *mif;
 


More information about the p4-projects mailing list