pmcf 1.46.0 → 1.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/host.mjs +3 -5
- package/src/utils.mjs +2 -2
- package/types/utils.d.mts +1 -1
package/package.json
CHANGED
package/src/host.mjs
CHANGED
|
@@ -376,12 +376,10 @@ export class NetworkInterface extends Base {
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
addSubnet(address) {
|
|
379
|
-
if(hasWellKnownSubnet(address)) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
379
|
if (!this.network) {
|
|
384
|
-
|
|
380
|
+
if (!hasWellKnownSubnet(address)) {
|
|
381
|
+
this.error("Missing network", address);
|
|
382
|
+
}
|
|
385
383
|
} else {
|
|
386
384
|
return this.network.addSubnet(address);
|
|
387
385
|
}
|
package/src/utils.mjs
CHANGED
|
@@ -153,7 +153,7 @@ export function normalizeCIDR(address) {
|
|
|
153
153
|
prefixLength = 8;
|
|
154
154
|
prefix = _decode(definition, n, prefixLength);
|
|
155
155
|
} else if (n === IPV6_LOCALHOST) {
|
|
156
|
-
prefixLength =
|
|
156
|
+
prefixLength = 128;
|
|
157
157
|
prefix = _decode(definition, n, prefixLength);
|
|
158
158
|
} else {
|
|
159
159
|
return {};
|
|
@@ -167,7 +167,7 @@ export function normalizeCIDR(address) {
|
|
|
167
167
|
export function hasWellKnownSubnet(address)
|
|
168
168
|
{
|
|
169
169
|
const n = encodeIP(address);
|
|
170
|
-
return n === IPV4_LOCALHOST || n === IPV6_LOCALHOST;
|
|
170
|
+
return n === IPV4_LOCALHOST || n === IPV6_LOCALHOST || isLinkLocal(address);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
const IPV4_LOCALHOST = _encode(ipv4, "127.0.0.1");
|
package/types/utils.d.mts
CHANGED