add AAAA to bind sorter

This commit is contained in:
Craig Peterson 2017-09-13 10:15:11 -04:00
parent 1d9d2b1a19
commit bf85e299e7

View file

@ -49,6 +49,10 @@ func (z *zoneGenData) Less(i, j int) bool {
log.Fatalf("should not happen: IPs are not 4 bytes: %#v %#v", ta2, tb2)
}
return bytes.Compare(ipa, ipb) == -1
case dns.TypeAAAA:
ta2, tb2 := a.(*dns.AAAA), b.(*dns.AAAA)
ipa, ipb := ta2.AAAA.To16(), tb2.AAAA.To16()
return bytes.Compare(ipa, ipb) == -1
case dns.TypeMX:
ta2, tb2 := a.(*dns.MX), b.(*dns.MX)
pa, pb := ta2.Preference, tb2.Preference