Some DNS response may be valid from a protocol point of view but may not
contain any IP addresses.
This patch gives a new flag to the function dns_get_ip_from_response to
report such case.
It's up to the upper layer to decide what to do with this information.
* matching preference was found */
DNS_UPD_CNAME, /* CNAME without any IP provided in the response */
DNS_UPD_NAME_ERROR, /* name in the response did not match the query */
+ DNS_UPD_NO_IP_FOUND, /* no IP could be found in the response */
};
#endif /* _TYPES_DNS_H */
return DNS_UPD_CNAME;
}
+ /* no IP found in the response */
+ if (!newip4 && !newip6) {
+ return DNS_UPD_NO_IP_FOUND;
+ }
+
/* case when the caller looks first for an IPv4 address */
if (family_priority == AF_INET) {
if (newip4) {
}
goto invalid;
+ case DNS_UPD_NO_IP_FOUND:
+ if (resolution->status != RSLV_STATUS_OTHER) {
+ resolution->status = RSLV_STATUS_OTHER;
+ resolution->last_status_change = now_ms;
+ }
+ goto stop_resolution;
+
default:
goto invalid;