The address family of an object might be either `0` or `null` so loosen
the checks to accomodate both.
Ref: https://github.com/jow-/ucode/commit/
aa860a35252b4833a188f8b2f9c6a7d68963767d
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
return false;
}
-let is_family = (x, v) => (x.family == 0 || x.family == v);
-let family_is_ipv4 = (x) => (x.family == 0 || x.family == 4);
-let family_is_ipv6 = (x) => (x.family == 0 || x.family == 6);
+let is_family = (x, v) => (!x.family || x.family == v);
+let family_is_ipv4 = (x) => (!x.family || x.family == 4);
+let family_is_ipv6 = (x) => (!x.family || x.family == 6);
function infer_family(f, objects) {
let res = f;
desc = objects[i + 1];
for (let obj in objs) {
- if (!obj || obj.family == 0 || obj.family == res)
+ if (!obj || !obj.family || obj.family == res)
continue;
if (res == 0) {