Building samba4 against system Heimdal

Luke Howard lukeh at padl.com
Thu May 12 12:27:49 MDT 2011


Debugging the SRV lookup code, I'm no DNS expert by a long shot, but it looks like it's possibly missing an extra call to rk_dns_lookup() in run_child_dns_lookup()?

Present logic is:

run_child_dns_lookup()
{
        reply = rk_dns_lookup(state->name.name, do_srv?"SRV":"A");

	for (rr=reply->head; rr; rr=rr->next) { 
		// if SRV record, add to srv_rr and increment srv_valid
	}
	for (i=0; i < srv_valid; i++) {
		for (rr=reply->head;rr;rr=rr->next) { 
			// if A record, add to addrs_rr
		}
	}
}

It seems to me that the code is assuming the DNS server sends back an A record as well as the SRV record (which the Windows DNS server doesn't do). Should the logic be:

run_child_dns_lookup()
{
        reply = rk_dns_lookup(state->name.name, do_srv?"SRV":"A");

	for (rr=reply->head; rr; rr=rr->next) { 
		// if SRV record, add to srv_rr and increment srv_valid
	}
	for (i=0; i < srv_valid; i++) {
		reply2 = rk_dns_lookup(srv_rr[i]->u.srv.target, "A");

		for (rr=reply2->head;rr;rr=rr->next) { 
			// if A record, add to addrs_rr
		}
	}
}

Or am I missing something? Also is there a call to rk_dns_free_data() missing?

-- Luke


More information about the samba-technical mailing list