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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.51.2",
3
+ "version": "2.51.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -126,19 +126,25 @@ export class DHCPService extends Service {
126
126
  );
127
127
 
128
128
  const peers = (
129
- await Array.fromAsync(network.findServices({ type: "dhcp" }))
130
- ).map(dhcp => {
131
- const ctrlAgentEndpoint = dhcp.endpoint(
132
- e => e.type === "kea-control-agent"
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
- return {
136
- name: dhcp.host.name,
137
- role: dhcp.priority < 10 ? "primary" : "standby",
138
- url: ctrlAgentEndpoint?.url
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
- "ip-address": ddnsEndpoint.address,
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"