pmcf 2.60.1 → 2.60.3
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 +2 -2
- package/src/services/kea.mjs +16 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"ip-utilties": "^1.4.
|
|
48
|
+
"ip-utilties": "^1.4.3",
|
|
49
49
|
"npm-pkgbuild": "^18.2.8",
|
|
50
50
|
"pacc": "^3.4.3",
|
|
51
51
|
"pkg-dir": "^8.0.0"
|
package/src/services/kea.mjs
CHANGED
|
@@ -162,7 +162,10 @@ export class KeaService extends Service {
|
|
|
162
162
|
const peers = async family =>
|
|
163
163
|
(
|
|
164
164
|
await Array.fromAsync(
|
|
165
|
-
network.findServices({
|
|
165
|
+
network.findServices({
|
|
166
|
+
type: "dhcp",
|
|
167
|
+
priority: ">=" + (this.priority < 100 ? this.priority : 100)
|
|
168
|
+
})
|
|
166
169
|
)
|
|
167
170
|
)
|
|
168
171
|
.sort(sortDescendingByPriority)
|
|
@@ -354,14 +357,20 @@ export class KeaService extends Service {
|
|
|
354
357
|
}
|
|
355
358
|
}
|
|
356
359
|
|
|
357
|
-
const reservations = family =>
|
|
360
|
+
const reservations = (subnet, family) =>
|
|
358
361
|
[...hwmap]
|
|
359
362
|
.map(([k, networkInterface]) => {
|
|
363
|
+
let addr = networkInterface.networkAddress(
|
|
364
|
+
n => n.family === `IPv${family}`
|
|
365
|
+
)?.address;
|
|
366
|
+
|
|
367
|
+
if(!addr || !subnet.matchesAddress(addr)) {
|
|
368
|
+
addr = undefined;
|
|
369
|
+
}
|
|
370
|
+
|
|
360
371
|
return {
|
|
361
372
|
"hw-address": k,
|
|
362
|
-
"ip-address":
|
|
363
|
-
n => n.family === `IPv${family}`
|
|
364
|
-
)?.address,
|
|
373
|
+
"ip-address": addr,
|
|
365
374
|
hostname: networkInterface.domainName,
|
|
366
375
|
"client-classes": ["SKIP_DDNS"]
|
|
367
376
|
};
|
|
@@ -400,7 +409,7 @@ export class KeaService extends Service {
|
|
|
400
409
|
data: network.gateway.address
|
|
401
410
|
}
|
|
402
411
|
],
|
|
403
|
-
reservations: reservations("4")
|
|
412
|
+
reservations: reservations(subnet, "4")
|
|
404
413
|
};
|
|
405
414
|
})
|
|
406
415
|
}
|
|
@@ -425,7 +434,7 @@ export class KeaService extends Service {
|
|
|
425
434
|
"delegated-len": 64
|
|
426
435
|
}
|
|
427
436
|
],*/
|
|
428
|
-
reservations: reservations("6")
|
|
437
|
+
reservations: reservations(subnet, "6")
|
|
429
438
|
};
|
|
430
439
|
})
|
|
431
440
|
}
|