76fb775 Sort and shuffle SRV record by priority and weight

7 files Authored by cheimes 5 years ago, Committed by tdudlak 5 years ago,
    Sort and shuffle SRV record by priority and weight
    
    On multiple occasions, SRV query answers were not properly sorted by
    priority. Records with same priority weren't randomized and shuffled.
    This caused FreeIPA to contact the same remote peer instead of
    distributing the load across all available servers.
    
    Two new helper functions now take care of SRV queries. sort_prio_weight()
    sorts SRV and URI records. query_srv() combines SRV lookup with
    sort_prio_weight().
    
    Fixes: https://pagure.io/freeipa/issue/7475
    Signed-off-by: Christian Heimes <cheimes@redhat.com>
    Reviewed-By: Rob Crittenden <rcritten@redhat.com>
    
        
file modified
+7 -14
file modified
+5 -6
file modified
+4 -4
file modified
+91 -1
file modified
+2 -2