Browse code

core: print rdata pointer and wrap null condition around it in dbg message

Daniel-Constantin Mierla authored on 18/04/2014 22:20:19
Showing 1 changed files
... ...
@@ -2367,10 +2367,12 @@ retry:
2367 2367
 found:
2368 2368
 #ifdef DNS_CACHE_DEBUG
2369 2369
 	DBG("dns_srv_get_nxt_rr(%p, %lx, %d, %u): selected %d/%d in grp. %d"
2370
-			" (rand_w=%d, rr=%p p=%d w=%d rsum=%d)\n",
2370
+			" (rand_w=%d, rr=%p rd=%p p=%d w=%d rsum=%d)\n",
2371 2371
 		e, (unsigned long)*tried, *no, now, i, idx, n, rand_w, r_sums[i].rr,
2372
-		((struct srv_rdata*)r_sums[i].rr->rdata)->priority,
2373
-		((struct srv_rdata*)r_sums[i].rr->rdata)->weight, r_sums[i].r_sum);
2372
+		r_sums[i].rr->rdata,
2373
+		(r_sums[i].rr->rdata)?((struct srv_rdata*)r_sums[i].rr->rdata)->priority:0,
2374
+		(r_sums[i].rr->rdata)?((struct srv_rdata*)r_sums[i].rr->rdata)->weight:0,
2375
+		r_sums[i].r_sum);
2374 2376
 #endif
2375 2377
 	/* i is the winner */
2376 2378
 	*no=n; /* grp. start */