From: Francis Dupont Date: Sun, 12 May 2024 14:43:20 +0000 (+0200) Subject: [#3378] Removed ip-address from relay syntax X-Git-Tag: Kea-2.6.0~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bee75d3dcfccb045e30263e2efa601e384d5333;p=thirdparty%2Fkea.git [#3378] Removed ip-address from relay syntax --- diff --git a/ChangeLog b/ChangeLog index c276fb634a..197b7c51c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2231. [func] fdupont + The "ip-address" parameter in the "relay" element + is no longer supported: it was replaced by + "ip-addresses" taking a list of addresses in Kea 1.4. + (Gitlab #3378) + 2230. [func] tmark Both kea-dhcp4 and kea-dhcp6 will now emit a INFO level log statement for each packet received and diff --git a/doc/examples/kea4/advanced.json b/doc/examples/kea4/advanced.json index 16a949831f..30d3333ac6 100644 --- a/doc/examples/kea4/advanced.json +++ b/doc/examples/kea4/advanced.json @@ -164,7 +164,7 @@ // valid cases when it makes sense. One case is when there // is a shared subnet. "relay": { - "ip-address": "192.168.1.1" + "ip-addresses": [ "192.168.1.1" ] } }, { diff --git a/doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json b/doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json index 91912169f0..fdef507e70 100644 --- a/doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json +++ b/doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json @@ -245,7 +245,7 @@ // This subnet will be selected for queries coming from the following // IP address. - "relay": { "ip-address": "192.168.56.1" } + "relay": { "ip-addresses": [ "192.168.56.1" ] } } ], diff --git a/doc/examples/kea4/ha-load-balancing-server2-mt.json b/doc/examples/kea4/ha-load-balancing-server2-mt.json index ab31cfa692..154a129f8a 100644 --- a/doc/examples/kea4/ha-load-balancing-server2-mt.json +++ b/doc/examples/kea4/ha-load-balancing-server2-mt.json @@ -228,7 +228,7 @@ // This subnet will be selected for queries coming from the following // IP address. - "relay": { "ip-address": "192.168.56.1" } + "relay": { "ip-addresses": [ "192.168.56.1" ] } } ], diff --git a/doc/examples/kea4/shared-network.json b/doc/examples/kea4/shared-network.json index 4b5a4749a2..ae9881300d 100644 --- a/doc/examples/kea4/shared-network.json +++ b/doc/examples/kea4/shared-network.json @@ -59,7 +59,7 @@ // It would be better to skip the relay scope altogether, but // it was left here for demonstration purposes. "relay": { - "ip-address": "0.0.0.0" + "ip-addresses": [ "0.0.0.0" ] }, // Timer values can be overridden here. @@ -99,7 +99,7 @@ // here if your relay uses different IP addresses for // each subnet. "relay": { - "ip-address": "0.0.0.0" + "ip-addresses": [ "0.0.0.0" ] }, "renew-timer": 10, // "reservation-mode": "all", diff --git a/doc/examples/kea6/advanced.json b/doc/examples/kea6/advanced.json index 02ff310f9c..6d4537c64a 100644 --- a/doc/examples/kea6/advanced.json +++ b/doc/examples/kea6/advanced.json @@ -153,7 +153,7 @@ // makes sense. One case is when the relay has only link-local address // and another is when there is a shared subnet scenario. "relay": { - "ip-address": "3000::1" + "ip-addresses": [ "3000::1" ] } } ], diff --git a/doc/examples/kea6/shared-network.json b/doc/examples/kea6/shared-network.json index 0b3416e7db..c0405bb8d4 100644 --- a/doc/examples/kea6/shared-network.json +++ b/doc/examples/kea6/shared-network.json @@ -67,7 +67,7 @@ "rapid-commit": true, "rebind-timer": 150, "relay": { - "ip-address": "2001:db8::1" + "ip-addresses": [ "2001:db8::1" ] }, "renew-timer": 100, @@ -99,7 +99,7 @@ "rebind-timer": 20, // It is possible to override some values here. "relay": { - "ip-address": "2001:db8:1::123" + "ip-addresses": [ "2001:db8:1::123" ] }, "renew-timer": 10, // "reservation-mode": "all", @@ -127,7 +127,7 @@ "rapid-commit": false, "rebind-timer": 20, "relay": { - "ip-address": "3000::1" + "ip-addresses": [ "3000::1" ] }, "renew-timer": 10, // "reservation-mode": "all", diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index 4da0834c84..473a32e6c0 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -4861,7 +4861,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) { " \"rebind-timer\": 2, " " \"valid-lifetime\": 4," " \"relay\": { " - " \"ip-address\": \"192.0.2.123\"" + " \"ip-addresses\": [ \"192.0.2.123\" ]" " }," " \"subnet\": \"192.0.2.0/24\" } ]," "\"valid-lifetime\": 4000 }"; @@ -6673,7 +6673,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) { " \"boot-file-name\": \"bar\",\n" " \"store-extended-info\": true,\n" " \"relay\": {\n" - " \"ip-address\": \"5.6.7.8\"\n" + " \"ip-addresses\": [ \"5.6.7.8\" ]\n" " },\n" " \"reservations-global\": false,\n" " \"reservations-in-subnet\": false,\n" @@ -6702,7 +6702,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) { " \"server-hostname\": \"some-name.example.org\",\n" " \"boot-file-name\": \"bootfile.efi\",\n" " \"relay\": {\n" - " \"ip-address\": \"55.66.77.88\"\n" + " \"ip-addresses\": [ \"55.66.77.88\" ]\n" " },\n" " \"reservations-global\": false,\n" " \"reservations-in-subnet\": true,\n" diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index 7c8d95ab9b..b97776e72e 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -4292,13 +4292,13 @@ TEST_F(Dhcpv4SrvTest, relayOverride) { "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.2\"" + " \"ip-addresses\": [ \"192.0.5.2\" ]" " }," " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" } " @@ -4381,13 +4381,13 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) { "{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ]," " \"client-class\": \"foo\", " " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " "{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 2, " " \"subnet\": \"192.0.3.0/24\" } " @@ -4444,7 +4444,7 @@ TEST_F(Dhcpv4SrvTest, relayLinkSelect) { "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " @@ -4579,7 +4579,7 @@ TEST_F(Dhcpv4SrvTest, relayIgnoreLinkSelect) { "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " @@ -4715,7 +4715,7 @@ TEST_F(Dhcpv4SrvTest, subnetSelect) { "\"subnet4\": [ " "{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ]," " \"relay\": { " - " \"ip-address\": \"192.0.5.1\"" + " \"ip-addresses\": [ \"192.0.5.1\" ]" " }," " \"id\": 1, " " \"subnet\": \"192.0.2.0/24\" }, " diff --git a/src/bin/dhcp4/tests/dora_unittest.cc b/src/bin/dhcp4/tests/dora_unittest.cc index c528cbffa6..d2be81dfea 100644 --- a/src/bin/dhcp4/tests/dora_unittest.cc +++ b/src/bin/dhcp4/tests/dora_unittest.cc @@ -413,7 +413,7 @@ const char* DORA_CONFIGS[] = { " \"id\": 3, " " \"pools\": [ { \"pool\": \"192.0.2.65-192.0.2.100\" } ]," " \"relay\": {" - " \"ip-address\": \"10.2.3.4\"" + " \"ip-addresses\": [ \"10.2.3.4\" ]" " }" " }" "]" diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index 3962803784..2f483876b8 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1339,7 +1339,7 @@ const char* EXTRACTED_CONFIGS[] = { " ],\n" " \"rebind-timer\": 2,\n" " \"relay\": {\n" -" \"ip-address\": \"192.0.2.123\"\n" +" \"ip-addresses\": [ \"192.0.2.123\" ]\n" " },\n" " \"renew-timer\": 1,\n" " \"subnet\": \"192.0.2.0/24\",\n" diff --git a/src/bin/dhcp4/tests/host_options_unittest.cc b/src/bin/dhcp4/tests/host_options_unittest.cc index 8fbb465409..7685f5bc78 100644 --- a/src/bin/dhcp4/tests/host_options_unittest.cc +++ b/src/bin/dhcp4/tests/host_options_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2016-2023 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -95,7 +95,7 @@ const char* HOST_CONFIGS[] = { "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " " \"id\": 1," - " \"relay\": { \"ip-address\": \"10.0.0.233\" }," + " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] }," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"option-data\": [ {" " \"name\": \"routers\"," @@ -137,7 +137,7 @@ const char* HOST_CONFIGS[] = { "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " " \"id\": 1," - " \"relay\": { \"ip-address\": \"10.0.0.233\" }," + " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] }," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"option-data\": [ {" " \"name\": \"routers\"," @@ -179,7 +179,7 @@ const char* HOST_CONFIGS[] = { "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " " \"id\": 1," - " \"relay\": { \"ip-address\": \"10.0.0.233\" }," + " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] }," " \"reservations\": [ " " {" " \"hw-address\": \"aa:bb:cc:dd:ee:ff\"," @@ -213,7 +213,7 @@ const char* HOST_CONFIGS[] = { "\"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\", " " \"id\": 1," - " \"relay\": { \"ip-address\": \"10.0.0.233\" }," + " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] }," " \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]," " \"reservations\": [ " " {" diff --git a/src/bin/dhcp4/tests/shared_network_unittest.cc b/src/bin/dhcp4/tests/shared_network_unittest.cc index f231e914a7..a92a420e7e 100644 --- a/src/bin/dhcp4/tests/shared_network_unittest.cc +++ b/src/bin/dhcp4/tests/shared_network_unittest.cc @@ -95,7 +95,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -115,7 +115,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"192.0.2.64/26\"," " \"id\": 1000," " \"relay\": {" - " \"ip-address\": \"192.1.2.3\"" + " \"ip-addresses\": [ \"192.1.2.3\" ]" " }," " \"pools\": [" " {" @@ -148,7 +148,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -197,7 +197,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -236,7 +236,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -286,7 +286,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -343,7 +343,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -527,7 +527,7 @@ const char* NETWORKS_CONFIG[] = { " \"shared-networks\": [" " {" " \"name\": \"frog\"," - " \"relay\": { \"ip-address\": \"10.1.2.3\" }," + " \"relay\": { \"ip-addresses\": [ \"10.1.2.3\" ] }," " \"subnet4\": [" " {" " \"subnet\": \"192.0.2.0/26\"," @@ -551,7 +551,7 @@ const char* NETWORKS_CONFIG[] = { " }," " {" " \"name\": \"dog\"," - " \"relay\": { \"ip-address\": \"192.1.2.3\" }," + " \"relay\": { \"ip-addresses\": [ \"192.1.2.3\" ] }," " \"subnet4\": [" " {" " \"subnet\": \"10.0.0.0/26\"," @@ -593,7 +593,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -764,14 +764,14 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" " \"subnet\": \"192.0.2.0/26\"," " \"id\": 10," " \"relay\": {" - " \"ip-address\": \"192.1.1.1\"" + " \"ip-addresses\": [ \"192.1.1.1\" ]" " }," " \"pools\": [" " {" @@ -783,7 +783,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"10.0.0.0/24\"," " \"id\": 100," " \"relay\": {" - " \"ip-address\": \"192.2.2.2\"" + " \"ip-addresses\": [ \"192.2.2.2\" ]" " }," " \"pools\": [" " {" @@ -799,7 +799,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"192.0.2.64/26\"," " \"id\": 1000," " \"relay\": {" - " \"ip-address\": \"192.3.3.3\"" + " \"ip-addresses\": [ \"192.3.3.3\" ]" " }," " \"pools\": [" " {" @@ -1028,7 +1028,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -1068,7 +1068,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" @@ -1108,7 +1108,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"192.3.5.6\"" + " \"ip-addresses\": [ \"192.3.5.6\" ]" " }," " \"subnet4\": [" " {" diff --git a/src/bin/dhcp6/tests/classify_unittests.cc b/src/bin/dhcp6/tests/classify_unittests.cc index 4ef414eaaa..85b1ef7e92 100644 --- a/src/bin/dhcp6/tests/classify_unittests.cc +++ b/src/bin/dhcp6/tests/classify_unittests.cc @@ -1595,14 +1595,14 @@ TEST_F(ClassifyTest, relayOverrideAndClientClass) { " \"subnet\": \"2001:db8:1::/48\", " " \"client-class\": \"foo\", " " \"relay\": { " - " \"ip-address\": \"2001:db8:3::1\"" + " \"ip-addresses\": [ \"2001:db8:3::1\" ]" " }" " }, " " { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"id\": 2, " " \"subnet\": \"2001:db8:2::/48\", " " \"relay\": { " - " \"ip-address\": \"2001:db8:3::1\"" + " \"ip-addresses\": [ \"2001:db8:3::1\" ]" " }" " } " "]," diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index 1a0161b41b..c4ed0cfe31 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -4794,7 +4794,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfo) { " \"id\": 1," " \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ]," " \"relay\": { " - " \"ip-address\": \"2001:db8:1::abcd\"" + " \"ip-addresses\": [ \"2001:db8:1::abcd\" ]" " }," " \"subnet\": \"2001:db8:1::/64\" } ]," "\"preferred-lifetime\": 3000, " @@ -7038,7 +7038,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) { " \"interface-id\": \"oneone\",\n" " \"store-extended-info\": true,\n" " \"relay\": {\n" - " \"ip-address\": \"1111::1\"\n" + " \"ip-addresses\": [ \"1111::1\" ]\n" " },\n" " \"rapid-commit\": true,\n" " \"reservations-global\": false,\n" @@ -7059,7 +7059,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) { " \"min-preferred-lifetime\": 200,\n" " \"max-preferred-lifetime\": 400,\n" " \"relay\": {\n" - " \"ip-address\": \"2222::2\"\n" + " \"ip-addresses\": [ \"2222::2\" ]\n" " },\n" " \"valid-lifetime\": 400, \n" " \"min-valid-lifetime\": 300, \n" diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 707be3a91f..78cc98dea3 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -3189,14 +3189,14 @@ TEST_F(Dhcpv6SrvTest, relayOverride) { " \"id\": 1, " " \"subnet\": \"2001:db8:1::/48\", " " \"relay\": { " - " \"ip-address\": \"2001:db8:3::1\"" + " \"ip-addresses\": [ \"2001:db8:3::1\" ]" " }" " }, " " { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ]," " \"id\": 2, " " \"subnet\": \"2001:db8:2::/48\", " " \"relay\": { " - " \"ip-address\": \"2001:db8:3::2\"" + " \"ip-addresses\": [ \"2001:db8:3::2\" ]" " }" " } " "]," diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 2a931f3b2d..2c0cace701 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -972,7 +972,7 @@ const char* EXTRACTED_CONFIGS[] = { " }\n" " ],\n" " \"relay\": {\n" -" \"ip-address\": \"2001:db8:1::abcd\"\n" +" \"ip-addresses\": [ \"2001:db8:1::abcd\" ]\n" " },\n" " \"subnet\": \"2001:db8:1::/64\"\n" " }\n" diff --git a/src/bin/dhcp6/tests/shared_network_unittest.cc b/src/bin/dhcp6/tests/shared_network_unittest.cc index 3b902554b8..1e07960c34 100644 --- a/src/bin/dhcp6/tests/shared_network_unittest.cc +++ b/src/bin/dhcp6/tests/shared_network_unittest.cc @@ -100,7 +100,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"3001::1\"" + " \"ip-addresses\": [ \"3001::1\" ]" " }," " \"subnet6\": [" " {" @@ -120,7 +120,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"2001:db8:2::/64\"," " \"id\": 1000," " \"relay\": {" - " \"ip-address\": \"3001::2\"" + " \"ip-addresses\": [ \"3001::2\" ]" " }," " \"pools\": [" " {" @@ -510,7 +510,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"frog\"," " \"relay\": {" - " \"ip-address\": \"3000::1\"" + " \"ip-addresses\": [ \"3000::1\" ]" " }," " \"subnet6\": [" " {" @@ -536,7 +536,7 @@ const char* NETWORKS_CONFIG[] = { " {" " \"name\": \"dog\"," " \"relay\": {" - " \"ip-address\": \"3000::2\"" + " \"ip-addresses\": [ \"3000::2\" ]" " }," " \"subnet6\": [" " {" @@ -716,7 +716,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"2001:db8:1::/64\"," " \"id\": 10," " \"relay\": {" - " \"ip-address\": \"3001::1\"" + " \"ip-addresses\": [ \"3001::1\" ]" " }," " \"pools\": [" " {" @@ -728,7 +728,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"2001:db8:2::/64\"," " \"id\": 100," " \"relay\": {" - " \"ip-address\": \"3001::1\"" + " \"ip-addresses\": [ \"3001::1\" ]" " }," " \"pools\": [" " {" @@ -744,7 +744,7 @@ const char* NETWORKS_CONFIG[] = { " \"subnet\": \"2001:db8:3::/64\"," " \"id\": 1000," " \"relay\": {" - " \"ip-address\": \"3001::2\"" + " \"ip-addresses\": [ \"3001::2\" ]" " }," " \"pools\": [" " {" diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.cc b/src/lib/dhcpsrv/dhcpsrv_messages.cc index b3b3b3b5f4..855a80af70 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.cc +++ b/src/lib/dhcpsrv/dhcpsrv_messages.cc @@ -35,7 +35,6 @@ extern const isc::log::MessageID DHCPSRV_CFGMGR_NO_SUBNET6 = "DHCPSRV_CFGMGR_NO_ extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET4 = "DHCPSRV_CFGMGR_ONLY_SUBNET4"; extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET6 = "DHCPSRV_CFGMGR_ONLY_SUBNET6"; extern const isc::log::MessageID DHCPSRV_CFGMGR_OPTION_DUPLICATE = "DHCPSRV_CFGMGR_OPTION_DUPLICATE"; -extern const isc::log::MessageID DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED = "DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED"; extern const isc::log::MessageID DHCPSRV_CFGMGR_RENEW_GTR_REBIND = "DHCPSRV_CFGMGR_RENEW_GTR_REBIND"; extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED = "DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED"; extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT = "DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT"; @@ -322,7 +321,6 @@ const char* values[] = { "DHCPSRV_CFGMGR_ONLY_SUBNET4", "retrieved subnet %1 for address hint %2", "DHCPSRV_CFGMGR_ONLY_SUBNET6", "retrieved subnet %1 for address hint %2", "DHCPSRV_CFGMGR_OPTION_DUPLICATE", "multiple options with the code: %1 added to the subnet: %2", - "DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED", "\"relay\" uses \"ip-address\", which has been deprecated, please use \"ip-addresses\": %1", "DHCPSRV_CFGMGR_RENEW_GTR_REBIND", "in %1, the value of renew-timer %2 is greater than the value of rebind-timer %3, ignoring renew-timer", "DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED", "use of raw sockets is unsupported on this OS, UDP sockets will be used", "DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT", "\"dhcp-socket-type\" not specified , using default socket type %1", diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.h b/src/lib/dhcpsrv/dhcpsrv_messages.h index 28f9e45233..dd467ef99e 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.h +++ b/src/lib/dhcpsrv/dhcpsrv_messages.h @@ -36,7 +36,6 @@ extern const isc::log::MessageID DHCPSRV_CFGMGR_NO_SUBNET6; extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET4; extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET6; extern const isc::log::MessageID DHCPSRV_CFGMGR_OPTION_DUPLICATE; -extern const isc::log::MessageID DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED; extern const isc::log::MessageID DHCPSRV_CFGMGR_RENEW_GTR_REBIND; extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED; extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT; diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index b7eba47f38..13400c778d 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -168,12 +168,6 @@ This warning message is issued on an attempt to configure multiple options with same option code for the particular subnet. Adding multiple options is uncommon for DHCPv6, but it is not prohibited. -% DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED "relay" uses "ip-address", which has been deprecated, please use "ip-addresses": %1 -This is debug message issued when the "relay" element being parse -contains "ip-address" rather than its replacement, "ip-addresses". -The server will still honor the value but users are encouraged to -move to the new list parameter. - % DHCPSRV_CFGMGR_RENEW_GTR_REBIND in %1, the value of renew-timer %2 is greater than the value of rebind-timer %3, ignoring renew-timer A warning message that indicates the configured renew-timer is greater than the configured rebind-timer. The server will ignore the renew diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index 5fc899f6f1..0af6f854b4 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc @@ -275,30 +275,14 @@ RelayInfoParser::parse(const isc::dhcp::Network::RelayInfoPtr& relay_info, isc_throw(DhcpConfigError, "relay must be a map"); } - ConstElementPtr address = relay_elem->get("ip-address"); ConstElementPtr addresses = relay_elem->get("ip-addresses"); - - if (address && addresses) { - isc_throw(DhcpConfigError, - "specify either ip-address or ip-addresses, not both"); - } - - if (!address && !addresses) { + if (!addresses) { isc_throw(DhcpConfigError, "ip-addresses is required"); } // Create our resultant RelayInfo structure *relay_info = isc::dhcp::Network::RelayInfo(); - if (address) { - addAddress("ip-address", getString(relay_elem, "ip-address"), - relay_elem, relay_info); - LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, - DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED) - .arg(getPosition("ip-address", relay_elem)); - return; - } - if (addresses->getType() != Element::list) { isc_throw(DhcpConfigError, "ip-addresses must be a list " "(" << getPosition("ip-addresses", relay_elem) << ")"); diff --git a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc index 2e8ce90959..e9731b266c 100644 --- a/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc +++ b/src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc @@ -2591,7 +2591,7 @@ TEST_F(ParseConfigTest, validRelayInfo4) { // Relay information structure. Very simple for now. std::string config_str = " {" - " \"ip-address\" : \"192.0.2.1\"" + " \"ip-addresses\" : [ \"192.0.2.1\" ]" " }"; ElementPtr json = Element::fromJSON(config_str); @@ -2610,14 +2610,14 @@ TEST_F(ParseConfigTest, bogusRelayInfo4) { // Invalid config (wrong family type of the ip-address field) std::string config_str_bogus1 = " {" - " \"ip-address\" : \"2001:db8::1\"" + " \"ip-addresses\" : [ \"2001:db8::1\" ]" " }"; ElementPtr json_bogus1 = Element::fromJSON(config_str_bogus1); // Invalid config (that thing is not an IPv4 address) std::string config_str_bogus2 = " {" - " \"ip-address\" : \"256.345.123.456\"" + " \"ip-addresses\" : [ \"256.345.123.456\" ]" " }"; ElementPtr json_bogus2 = Element::fromJSON(config_str_bogus2); @@ -2648,7 +2648,7 @@ TEST_F(ParseConfigTest, validRelayInfo6) { // Relay information structure. Very simple for now. std::string config_str = " {" - " \"ip-address\" : \"2001:db8::1\"" + " \"ip-addresses\" : [ \"2001:db8::1\" ]" " }"; ElementPtr json = Element::fromJSON(config_str); @@ -2667,14 +2667,14 @@ TEST_F(ParseConfigTest, bogusRelayInfo6) { // Invalid config (wrong family type of the ip-address field std::string config_str_bogus1 = " {" - " \"ip-address\" : \"192.0.2.1\"" + " \"ip-addresses\" : [ \"192.0.2.1\" ]" " }"; ElementPtr json_bogus1 = Element::fromJSON(config_str_bogus1); // That IPv6 address doesn't look right std::string config_str_bogus2 = " {" - " \"ip-address\" : \"2001:db8:::4\"" + " \"ip-addresses\" : [ \"2001:db8:::4\" ]" " }"; ElementPtr json_bogus2 = Element::fromJSON(config_str_bogus2); diff --git a/src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc b/src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc index 21d89f6338..61616c6db9 100644 --- a/src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc +++ b/src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc @@ -383,24 +383,6 @@ TEST_F(SharedNetwork4ParserTest, relayInfoTests) { // Create the vector of test scenarios. std::vector tests = { - { - "valid ip-address #1", - "{ \"ip-address\": \"192.168.2.1\" }", - true, - { asiolink::IOAddress("192.168.2.1") } - }, - { - "invalid ip-address #1", - "{ \"ip-address\": \"not an address\" }", - false, - { } - }, - { - "invalid ip-address #2", - "{ \"ip-address\": \"2001:db8::1\" }", - false, - { } - }, { "valid ip-addresses #1", "{ \"ip-addresses\": [ ] }", @@ -432,16 +414,7 @@ TEST_F(SharedNetwork4ParserTest, relayInfoTests) { { } }, { - "invalid both ip-address and ip-addresses", - "{" - " \"ip-address\": \"192.168.2.1\", " - " \"ip-addresses\": [ \"192.168.2.1\", \"192.168.2.2\" ]" - " }", - false, - { } - }, - { - "invalid neither ip-address nor ip-addresses", + "invalid no ip-addresses", "{}", false, { } @@ -960,24 +933,6 @@ TEST_F(SharedNetwork6ParserTest, relayInfoTests) { // Create the vector of test scenarios. std::vector tests = { - { - "valid ip-address #1", - "{ \"ip-address\": \"2001:db8::1\" }", - true, - { asiolink::IOAddress("2001:db8::1") } - }, - { - "invalid ip-address #1", - "{ \"ip-address\": \"not an address\" }", - false, - { } - }, - { - "invalid ip-address #2", - "{ \"ip-address\": \"192.168.2.1\" }", - false, - { } - }, { "valid ip-addresses #1", "{ \"ip-addresses\": [ ] }", @@ -1009,16 +964,7 @@ TEST_F(SharedNetwork6ParserTest, relayInfoTests) { { } }, { - "invalid both ip-address and ip-addresses", - "{" - " \"ip-address\": \"2001:db8::1\", " - " \"ip-addresses\": [ \"2001:db8::1\", \"2001:db8::2\" ]" - " }", - false, - { } - }, - { - "invalid neither ip-address nor ip-addresses", + "invalid no ip-addresses", "{}", false, { }