pmcf 2.51.2 → 2.51.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 +1 -1
- package/src/services/dhcp.mjs +19 -13
package/package.json
CHANGED
package/src/services/dhcp.mjs
CHANGED
|
@@ -126,19 +126,25 @@ export class DHCPService extends Service {
|
|
|
126
126
|
);
|
|
127
127
|
|
|
128
128
|
const peers = (
|
|
129
|
-
await Array.fromAsync(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
)
|
|
129
|
+
await Array.fromAsync(
|
|
130
|
+
network.findServices({ type: "dhcp", priority: ">10" })
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
.sort((a, b) => (a.host === host ? -1 : 1))
|
|
134
|
+
.map((dhcp, i) => {
|
|
135
|
+
const ctrlAgentEndpoint = dhcp.endpoint(
|
|
136
|
+
e => e.type === "kea-control-agent"
|
|
137
|
+
);
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
return {
|
|
140
|
+
name: dhcp.host.name,
|
|
141
|
+
role: i === 0 ? "primary" : "standby",
|
|
142
|
+
url: ctrlAgentEndpoint?.url
|
|
143
|
+
};
|
|
144
|
+
});
|
|
141
145
|
|
|
146
|
+
peers.length = 2;
|
|
147
|
+
|
|
142
148
|
const commonConfig = {
|
|
143
149
|
"lease-database": {
|
|
144
150
|
type: "memfile",
|
|
@@ -245,8 +251,8 @@ export class DHCPService extends Service {
|
|
|
245
251
|
|
|
246
252
|
const dhcpServerDdns = {
|
|
247
253
|
"enable-updates": true,
|
|
248
|
-
"
|
|
249
|
-
port: ddnsEndpoint.port,
|
|
254
|
+
"server-address": ddnsEndpoint.address,
|
|
255
|
+
"server-port": ddnsEndpoint.port,
|
|
250
256
|
"max-queue-size": 64,
|
|
251
257
|
"ncr-protocol": "UDP",
|
|
252
258
|
"ncr-format": "JSON"
|