Skip to content

Commit 5bee75d

Browse files
committed
[#3378] Removed ip-address from relay syntax
1 parent 7415bca commit 5bee75d

24 files changed

+74
-147
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2231. [func] fdupont
2+
The "ip-address" parameter in the "relay" element
3+
is no longer supported: it was replaced by
4+
"ip-addresses" taking a list of addresses in Kea 1.4.
5+
(Gitlab #3378)
6+
17
2230. [func] tmark
28
Both kea-dhcp4 and kea-dhcp6 will now emit a INFO
39
level log statement for each packet received and

doc/examples/kea4/advanced.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
// valid cases when it makes sense. One case is when there
165165
// is a shared subnet.
166166
"relay": {
167-
"ip-address": "192.168.1.1"
167+
"ip-addresses": [ "192.168.1.1" ]
168168
}
169169
},
170170
{

doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245

246246
// This subnet will be selected for queries coming from the following
247247
// IP address.
248-
"relay": { "ip-address": "192.168.56.1" }
248+
"relay": { "ip-addresses": [ "192.168.56.1" ] }
249249
}
250250
],
251251

doc/examples/kea4/ha-load-balancing-server2-mt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228

229229
// This subnet will be selected for queries coming from the following
230230
// IP address.
231-
"relay": { "ip-address": "192.168.56.1" }
231+
"relay": { "ip-addresses": [ "192.168.56.1" ] }
232232
}
233233
],
234234

doc/examples/kea4/shared-network.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
// It would be better to skip the relay scope altogether, but
6060
// it was left here for demonstration purposes.
6161
"relay": {
62-
"ip-address": "0.0.0.0"
62+
"ip-addresses": [ "0.0.0.0" ]
6363
},
6464

6565
// Timer values can be overridden here.
@@ -99,7 +99,7 @@
9999
// here if your relay uses different IP addresses for
100100
// each subnet.
101101
"relay": {
102-
"ip-address": "0.0.0.0"
102+
"ip-addresses": [ "0.0.0.0" ]
103103
},
104104
"renew-timer": 10,
105105
// "reservation-mode": "all",

doc/examples/kea6/advanced.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
// makes sense. One case is when the relay has only link-local address
154154
// and another is when there is a shared subnet scenario.
155155
"relay": {
156-
"ip-address": "3000::1"
156+
"ip-addresses": [ "3000::1" ]
157157
}
158158
}
159159
],

doc/examples/kea6/shared-network.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"rapid-commit": true,
6868
"rebind-timer": 150,
6969
"relay": {
70-
"ip-address": "2001:db8::1"
70+
"ip-addresses": [ "2001:db8::1" ]
7171
},
7272
"renew-timer": 100,
7373

@@ -99,7 +99,7 @@
9999
"rebind-timer": 20,
100100
// It is possible to override some values here.
101101
"relay": {
102-
"ip-address": "2001:db8:1::123"
102+
"ip-addresses": [ "2001:db8:1::123" ]
103103
},
104104
"renew-timer": 10,
105105
// "reservation-mode": "all",
@@ -127,7 +127,7 @@
127127
"rapid-commit": false,
128128
"rebind-timer": 20,
129129
"relay": {
130-
"ip-address": "3000::1"
130+
"ip-addresses": [ "3000::1" ]
131131
},
132132
"renew-timer": 10,
133133
// "reservation-mode": "all",

src/bin/dhcp4/tests/config_parser_unittest.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4861,7 +4861,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) {
48614861
" \"rebind-timer\": 2, "
48624862
" \"valid-lifetime\": 4,"
48634863
" \"relay\": { "
4864-
" \"ip-address\": \"192.0.2.123\""
4864+
" \"ip-addresses\": [ \"192.0.2.123\" ]"
48654865
" },"
48664866
" \"subnet\": \"192.0.2.0/24\" } ],"
48674867
"\"valid-lifetime\": 4000 }";
@@ -6673,7 +6673,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
66736673
" \"boot-file-name\": \"bar\",\n"
66746674
" \"store-extended-info\": true,\n"
66756675
" \"relay\": {\n"
6676-
" \"ip-address\": \"5.6.7.8\"\n"
6676+
" \"ip-addresses\": [ \"5.6.7.8\" ]\n"
66776677
" },\n"
66786678
" \"reservations-global\": false,\n"
66796679
" \"reservations-in-subnet\": false,\n"
@@ -6702,7 +6702,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
67026702
" \"server-hostname\": \"some-name.example.org\",\n"
67036703
" \"boot-file-name\": \"bootfile.efi\",\n"
67046704
" \"relay\": {\n"
6705-
" \"ip-address\": \"55.66.77.88\"\n"
6705+
" \"ip-addresses\": [ \"55.66.77.88\" ]\n"
67066706
" },\n"
67076707
" \"reservations-global\": false,\n"
67086708
" \"reservations-in-subnet\": true,\n"

src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,13 +4292,13 @@ TEST_F(Dhcpv4SrvTest, relayOverride) {
42924292
"\"subnet4\": [ "
42934293
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
42944294
" \"relay\": { "
4295-
" \"ip-address\": \"192.0.5.1\""
4295+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
42964296
" },"
42974297
" \"id\": 1, "
42984298
" \"subnet\": \"192.0.2.0/24\" }, "
42994299
"{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
43004300
" \"relay\": { "
4301-
" \"ip-address\": \"192.0.5.2\""
4301+
" \"ip-addresses\": [ \"192.0.5.2\" ]"
43024302
" },"
43034303
" \"id\": 2, "
43044304
" \"subnet\": \"192.0.3.0/24\" } "
@@ -4381,13 +4381,13 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) {
43814381
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
43824382
" \"client-class\": \"foo\", "
43834383
" \"relay\": { "
4384-
" \"ip-address\": \"192.0.5.1\""
4384+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
43854385
" },"
43864386
" \"id\": 1, "
43874387
" \"subnet\": \"192.0.2.0/24\" }, "
43884388
"{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
43894389
" \"relay\": { "
4390-
" \"ip-address\": \"192.0.5.1\""
4390+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
43914391
" },"
43924392
" \"id\": 2, "
43934393
" \"subnet\": \"192.0.3.0/24\" } "
@@ -4444,7 +4444,7 @@ TEST_F(Dhcpv4SrvTest, relayLinkSelect) {
44444444
"\"subnet4\": [ "
44454445
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
44464446
" \"relay\": { "
4447-
" \"ip-address\": \"192.0.5.1\""
4447+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
44484448
" },"
44494449
" \"id\": 1, "
44504450
" \"subnet\": \"192.0.2.0/24\" }, "
@@ -4579,7 +4579,7 @@ TEST_F(Dhcpv4SrvTest, relayIgnoreLinkSelect) {
45794579
"\"subnet4\": [ "
45804580
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
45814581
" \"relay\": { "
4582-
" \"ip-address\": \"192.0.5.1\""
4582+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
45834583
" },"
45844584
" \"id\": 1, "
45854585
" \"subnet\": \"192.0.2.0/24\" }, "
@@ -4715,7 +4715,7 @@ TEST_F(Dhcpv4SrvTest, subnetSelect) {
47154715
"\"subnet4\": [ "
47164716
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
47174717
" \"relay\": { "
4718-
" \"ip-address\": \"192.0.5.1\""
4718+
" \"ip-addresses\": [ \"192.0.5.1\" ]"
47194719
" },"
47204720
" \"id\": 1, "
47214721
" \"subnet\": \"192.0.2.0/24\" }, "

src/bin/dhcp4/tests/dora_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ const char* DORA_CONFIGS[] = {
413413
" \"id\": 3, "
414414
" \"pools\": [ { \"pool\": \"192.0.2.65-192.0.2.100\" } ],"
415415
" \"relay\": {"
416-
" \"ip-address\": \"10.2.3.4\""
416+
" \"ip-addresses\": [ \"10.2.3.4\" ]"
417417
" }"
418418
" }"
419419
"]"

src/bin/dhcp4/tests/get_config_unittest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
1+
// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
22
//
33
// This Source Code Form is subject to the terms of the Mozilla Public
44
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1339,7 +1339,7 @@ const char* EXTRACTED_CONFIGS[] = {
13391339
" ],\n"
13401340
" \"rebind-timer\": 2,\n"
13411341
" \"relay\": {\n"
1342-
" \"ip-address\": \"192.0.2.123\"\n"
1342+
" \"ip-addresses\": [ \"192.0.2.123\" ]\n"
13431343
" },\n"
13441344
" \"renew-timer\": 1,\n"
13451345
" \"subnet\": \"192.0.2.0/24\",\n"

src/bin/dhcp4/tests/host_options_unittest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2016-2023 Internet Systems Consortium, Inc. ("ISC")
1+
// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
22
//
33
// This Source Code Form is subject to the terms of the Mozilla Public
44
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -95,7 +95,7 @@ const char* HOST_CONFIGS[] = {
9595
"\"subnet4\": [ { "
9696
" \"subnet\": \"10.0.0.0/24\", "
9797
" \"id\": 1,"
98-
" \"relay\": { \"ip-address\": \"10.0.0.233\" },"
98+
" \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
9999
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
100100
" \"option-data\": [ {"
101101
" \"name\": \"routers\","
@@ -137,7 +137,7 @@ const char* HOST_CONFIGS[] = {
137137
"\"subnet4\": [ { "
138138
" \"subnet\": \"10.0.0.0/24\", "
139139
" \"id\": 1,"
140-
" \"relay\": { \"ip-address\": \"10.0.0.233\" },"
140+
" \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
141141
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
142142
" \"option-data\": [ {"
143143
" \"name\": \"routers\","
@@ -179,7 +179,7 @@ const char* HOST_CONFIGS[] = {
179179
"\"subnet4\": [ { "
180180
" \"subnet\": \"10.0.0.0/24\", "
181181
" \"id\": 1,"
182-
" \"relay\": { \"ip-address\": \"10.0.0.233\" },"
182+
" \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
183183
" \"reservations\": [ "
184184
" {"
185185
" \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
@@ -213,7 +213,7 @@ const char* HOST_CONFIGS[] = {
213213
"\"subnet4\": [ { "
214214
" \"subnet\": \"10.0.0.0/24\", "
215215
" \"id\": 1,"
216-
" \"relay\": { \"ip-address\": \"10.0.0.233\" },"
216+
" \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
217217
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
218218
" \"reservations\": [ "
219219
" {"

src/bin/dhcp4/tests/shared_network_unittest.cc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const char* NETWORKS_CONFIG[] = {
9595
" {"
9696
" \"name\": \"frog\","
9797
" \"relay\": {"
98-
" \"ip-address\": \"192.3.5.6\""
98+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
9999
" },"
100100
" \"subnet4\": ["
101101
" {"
@@ -115,7 +115,7 @@ const char* NETWORKS_CONFIG[] = {
115115
" \"subnet\": \"192.0.2.64/26\","
116116
" \"id\": 1000,"
117117
" \"relay\": {"
118-
" \"ip-address\": \"192.1.2.3\""
118+
" \"ip-addresses\": [ \"192.1.2.3\" ]"
119119
" },"
120120
" \"pools\": ["
121121
" {"
@@ -148,7 +148,7 @@ const char* NETWORKS_CONFIG[] = {
148148
" {"
149149
" \"name\": \"frog\","
150150
" \"relay\": {"
151-
" \"ip-address\": \"192.3.5.6\""
151+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
152152
" },"
153153
" \"subnet4\": ["
154154
" {"
@@ -197,7 +197,7 @@ const char* NETWORKS_CONFIG[] = {
197197
" {"
198198
" \"name\": \"frog\","
199199
" \"relay\": {"
200-
" \"ip-address\": \"192.3.5.6\""
200+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
201201
" },"
202202
" \"subnet4\": ["
203203
" {"
@@ -236,7 +236,7 @@ const char* NETWORKS_CONFIG[] = {
236236
" {"
237237
" \"name\": \"frog\","
238238
" \"relay\": {"
239-
" \"ip-address\": \"192.3.5.6\""
239+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
240240
" },"
241241
" \"subnet4\": ["
242242
" {"
@@ -286,7 +286,7 @@ const char* NETWORKS_CONFIG[] = {
286286
" {"
287287
" \"name\": \"frog\","
288288
" \"relay\": {"
289-
" \"ip-address\": \"192.3.5.6\""
289+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
290290
" },"
291291
" \"subnet4\": ["
292292
" {"
@@ -343,7 +343,7 @@ const char* NETWORKS_CONFIG[] = {
343343
" {"
344344
" \"name\": \"frog\","
345345
" \"relay\": {"
346-
" \"ip-address\": \"192.3.5.6\""
346+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
347347
" },"
348348
" \"subnet4\": ["
349349
" {"
@@ -527,7 +527,7 @@ const char* NETWORKS_CONFIG[] = {
527527
" \"shared-networks\": ["
528528
" {"
529529
" \"name\": \"frog\","
530-
" \"relay\": { \"ip-address\": \"10.1.2.3\" },"
530+
" \"relay\": { \"ip-addresses\": [ \"10.1.2.3\" ] },"
531531
" \"subnet4\": ["
532532
" {"
533533
" \"subnet\": \"192.0.2.0/26\","
@@ -551,7 +551,7 @@ const char* NETWORKS_CONFIG[] = {
551551
" },"
552552
" {"
553553
" \"name\": \"dog\","
554-
" \"relay\": { \"ip-address\": \"192.1.2.3\" },"
554+
" \"relay\": { \"ip-addresses\": [ \"192.1.2.3\" ] },"
555555
" \"subnet4\": ["
556556
" {"
557557
" \"subnet\": \"10.0.0.0/26\","
@@ -593,7 +593,7 @@ const char* NETWORKS_CONFIG[] = {
593593
" {"
594594
" \"name\": \"frog\","
595595
" \"relay\": {"
596-
" \"ip-address\": \"192.3.5.6\""
596+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
597597
" },"
598598
" \"subnet4\": ["
599599
" {"
@@ -764,14 +764,14 @@ const char* NETWORKS_CONFIG[] = {
764764
" {"
765765
" \"name\": \"frog\","
766766
" \"relay\": {"
767-
" \"ip-address\": \"192.3.5.6\""
767+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
768768
" },"
769769
" \"subnet4\": ["
770770
" {"
771771
" \"subnet\": \"192.0.2.0/26\","
772772
" \"id\": 10,"
773773
" \"relay\": {"
774-
" \"ip-address\": \"192.1.1.1\""
774+
" \"ip-addresses\": [ \"192.1.1.1\" ]"
775775
" },"
776776
" \"pools\": ["
777777
" {"
@@ -783,7 +783,7 @@ const char* NETWORKS_CONFIG[] = {
783783
" \"subnet\": \"10.0.0.0/24\","
784784
" \"id\": 100,"
785785
" \"relay\": {"
786-
" \"ip-address\": \"192.2.2.2\""
786+
" \"ip-addresses\": [ \"192.2.2.2\" ]"
787787
" },"
788788
" \"pools\": ["
789789
" {"
@@ -799,7 +799,7 @@ const char* NETWORKS_CONFIG[] = {
799799
" \"subnet\": \"192.0.2.64/26\","
800800
" \"id\": 1000,"
801801
" \"relay\": {"
802-
" \"ip-address\": \"192.3.3.3\""
802+
" \"ip-addresses\": [ \"192.3.3.3\" ]"
803803
" },"
804804
" \"pools\": ["
805805
" {"
@@ -1028,7 +1028,7 @@ const char* NETWORKS_CONFIG[] = {
10281028
" {"
10291029
" \"name\": \"frog\","
10301030
" \"relay\": {"
1031-
" \"ip-address\": \"192.3.5.6\""
1031+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
10321032
" },"
10331033
" \"subnet4\": ["
10341034
" {"
@@ -1068,7 +1068,7 @@ const char* NETWORKS_CONFIG[] = {
10681068
" {"
10691069
" \"name\": \"frog\","
10701070
" \"relay\": {"
1071-
" \"ip-address\": \"192.3.5.6\""
1071+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
10721072
" },"
10731073
" \"subnet4\": ["
10741074
" {"
@@ -1108,7 +1108,7 @@ const char* NETWORKS_CONFIG[] = {
11081108
" {"
11091109
" \"name\": \"frog\","
11101110
" \"relay\": {"
1111-
" \"ip-address\": \"192.3.5.6\""
1111+
" \"ip-addresses\": [ \"192.3.5.6\" ]"
11121112
" },"
11131113
" \"subnet4\": ["
11141114
" {"

0 commit comments

Comments
 (0)