]> git.ipfire.org Git - thirdparty/pdns.git/commit
geoipbackend: propagate weighted rounding gap fix 8564/head
authorJeremy Clerc <j.clerc@criteo.com>
Wed, 20 Nov 2019 15:08:01 +0000 (16:08 +0100)
committerJeremy Clerc <j.clerc@criteo.com>
Wed, 20 Nov 2019 15:36:42 +0000 (16:36 +0100)
commit49b26e34fa3790a57e90c68f79c36dadfb78405c
treeac657b3589d41590a0eabaafacef76d48c144e5d
parent8cc411dc44a62cf5250f87900e78e7216af10096
geoipbackend: propagate weighted rounding gap fix

618824cb73db384d52cf379c7d49744dbb5b8f6d (PR#7219) fixed computation
of weighted round robin computation per Qtype.

That commit also introduced a bug on the removal of the rounding gap.

Because it works on a copy of a GeoIPDNSResourceRecord, the updated
weight of the last record is not propagated to the domain object.

The bug is as follow:
  1. The total weight is < 1000
  2. The random probabability gives 1000
  3. There is no resource to be given

This commit restore the original behavior of ensuring the gap is added
to the last resource so we always have 1000.
modules/geoipbackend/geoipbackend.cc