dns_get_ip_from_response() is used to compare the caller current IP to
the IP available in the records returned by the DNS server.
A scoring system is in place to get the best IP address available.
That said, in the current implementation, there are a couple of issues:
1. a comment does not match what the code does
2. the code does not match what the commet says (score value is not
incremented with '2')
This patch fixes both issues.
Backport status: 1.8
}
/* Check if the IP found in the record is already affected to a
- * member of a group. If yes, the score should be incremented
+ * member of a group. If not, the score should be incremented
* by 2. */
- if (owner && snr_check_ip_callback(owner, ip, &ip_type))
+ if (owner && snr_check_ip_callback(owner, ip, &ip_type)) {
continue;
+ } else {
+ score += 2;
+ }
/* Check for current ip matching. */
if (ip_type == currentip_sin_family &&