The algorithm used to select from the weighted SRV RRs of equal priority is adapted from one supplied by Dan Bernstein.