[ldns-users] ldns_rr_list_sort() sorts by which criterion?
roker at pep-project.org
Tue Aug 8 18:06:45 UTC 2017
> Since the MX 'PREFERENCE' field is stored at the beginning of the record
> data as a 16-bit big endian integer, the most preferred (lowest) values
> will be at the beginning of the list. But even if the RRs are sorted
> correctly for SMTP purposes, you still need to randomize among MX
> records with the same PREFERENCE, if you are going to make an SMTP
> connection. (RFC 5321 says "MUST randomize".)
Okay, so for MX and SRV records this ordering would work but is
sub-optimal, because it would work but violates the RFC.
Is there a function in LDNS library that does that "pick one at random"
from an RR List or do I have to write my own (and parse all the RR
members first and all that nasty PITA stuff)? :-o
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the ldns-users