Regression occurred that prevented the variable "family" from being set
properly when the lookup() function's "options" parameter was passed a
number instead of an object.
Also included a sanity check by setting the default value of "family" to
a value that will not pass verification.
Fixes: e643fe4 "dns: fix GetAddrInfo assert"
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
// lookup(hostname, [options,] callback)
exports.lookup = function lookup(hostname, options, callback) {
var hints = 0;
- var family = 0;
+ var family = -1;
// Parse arguments
if (typeof options === 'function') {
hints !== (exports.ADDRCONFIG | exports.V4MAPPED)) {
throw new TypeError('invalid argument: hints must use valid flags');
}
+ } else {
+ family = options >>> 0;
}
if (family !== 0 && family !== 4 && family !== 6)