Fix weight zero entries when ordering SRV RR results.
commiteb682c1bf4a91e20f233f385c640b17e49a9fe64
authorRoland C. Dowdeswell <roland.dowdeswell@twosigma.com>
Thu, 10 Mar 2016 22:06:52 +0000 (10 17:06 -0500)
committerViktor Dukhovni <viktor1ghub@dukhovni.org>
Thu, 10 Nov 2016 09:45:07 +0000 (10 04:45 -0500)
treee5dc858896a85f64d790521cad937cbb8fa59681
parent44a1a2a273d498ac8d9334930150b4480a2fbe5c
Fix weight zero entries when ordering SRV RR results.

In lib/roken/resolve.c, we find rk_dns_srv_order() which re-orders
the results of an SRV RR lookup by the algorithm in RFC2782.  We
note that the algorithm doesn't behave according to the RFC w.r.t.
entries of weight zero.  We solve this by scaling out the remaining
weights by the number of zeros we find at a particular priority
level and acting like the zero weights have a weight of one.
lib/roken/resolve.c