]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3378] Removed ip-address from relay syntax
authorFrancis Dupont <fdupont@isc.org>
Sun, 12 May 2024 14:43:20 +0000 (16:43 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 13 May 2024 16:15:43 +0000 (18:15 +0200)
24 files changed:
ChangeLog
doc/examples/kea4/advanced.json
doc/examples/kea4/ha-load-balancing-server1-mt-with-tls.json
doc/examples/kea4/ha-load-balancing-server2-mt.json
doc/examples/kea4/shared-network.json
doc/examples/kea6/advanced.json
doc/examples/kea6/shared-network.json
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp4/tests/get_config_unittest.cc
src/bin/dhcp4/tests/host_options_unittest.cc
src/bin/dhcp4/tests/shared_network_unittest.cc
src/bin/dhcp6/tests/classify_unittests.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.cc
src/bin/dhcp6/tests/shared_network_unittest.cc
src/lib/dhcpsrv/dhcpsrv_messages.cc
src/lib/dhcpsrv/dhcpsrv_messages.h
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/parsers/dhcp_parsers.cc
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc

index c276fb634abcf1364e04988f5787f6fd6816953b..197b7c51c11e8357604cad90cafe0a457743c24f 100644 (file)
--- 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
index 16a949831f89b7e126bd59a198ac215d55d2f242..30d3333ac623cf1e5ecf85d6a9ecaed39ae3291c 100644 (file)
             // 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" ]
             }
         },
         {
index 91912169f001c6a08f3baabff18a7818d6c85b08..fdef507e70bbf4d87123c2a21c64f2889427b59f 100644 (file)
 
             // 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" ] }
         }
     ],
 
index ab31cfa6922578d4f5f22c7adb991e83f0678b49..154a129f8ac1d2337a5c1d477d6c0b18b10e0673 100644 (file)
 
             // 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" ] }
         }
     ],
 
index 4b5a4749a27c4cf09aeb12a7084d5d84f676de60..ae9881300d1dfa34b400b0930bb1b96936e53ec4 100644 (file)
@@ -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",
index 02ff310f9cbeceb6f363108eb6a7b17a4d73b6a4..6d4537c64a3999eb9da00af49262bf165dd7a2f2 100644 (file)
         // 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" ]
         }
     }
     ],
index 0b3416e7db956cc864d013e720ac6e6bcf7887a4..c0405bb8d46b3c0f7086b9e2932af5ca91bb46a9 100644 (file)
@@ -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",
                     "rapid-commit": false,
                     "rebind-timer": 20,
                     "relay": {
-                        "ip-address": "3000::1"
+                        "ip-addresses": [ "3000::1" ]
                     },
                     "renew-timer": 10,
                     // "reservation-mode": "all",
index 4da0834c84baf7ef64c23446a6cc907fc4b59c54..473a32e6c00ac071a415722a40ed7dd17643482c 100644 (file)
@@ -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"
index 7c8d95ab9bb6b33e33b2fdfaef5013210d607126..b97776e72ee6d6f822cfcbc82ac5d3da3c7538b0 100644 (file)
@@ -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\" }, "
index c528cbffa67f6495875684b51908bfd6f0a1ac56..d2be81dfeae0b2324487adb55e793a6a3b62819a 100644 (file)
@@ -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\" ]"
         "        }"
         "    }"
         "]"
index 3962803784d913d8fa6b17c0fcbe7d1658a2b7e8..2f483876b88e6c799f2ce70cadb4502b4a13ca74 100644 (file)
@@ -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"
index 8fbb46540958df48ddeffdef22e8cf5809f279e3..7685f5bc78aa73544128927e2ef4a848ea4ba6d9 100644 (file)
@@ -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\": [ "
         "    {"
index f231e914a7f8a76de9acb10644eb84b9f19a0a4b..a92a420e7edd73d517769c107ed0000badec6d43 100644 (file)
@@ -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\": ["
     "                {"
index 4ef414eaaaf704c862643ea7cb99258081111254..85b1ef7e920ac2a3013f92ec50f8f6ca9c946bf6 100644 (file)
@@ -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\" ]"
         "    }"
         " } "
         "],"
index 1a0161b41b2088adf68469a1710f17eabe6dd42b..c4ed0cfe31105d75c2dd440aa46e038314dc6c6d 100644 (file)
@@ -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"
index 707be3a91fba55f43388cce5b908b9d735511241..78cc98dea3f0596179a7d66b6668a938f21f4e2a 100644 (file)
@@ -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\" ]"
         "    }"
         " } "
         "],"
index 2a931f3b2da8aad30f8e0a9147a8c065cf5ab4df..2c0cace701217968bb2a1dea659c9a395aad5884 100644 (file)
@@ -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"
index 3b902554b81e9b2a9ba3d494421a0665f1253e5d..1e07960c344d3fd2bfa1227bd365601fc59c63ec 100644 (file)
@@ -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\": ["
     "                {"
index b3b3b3b5f45472e55fcf529d6286f05204c93eb4..855a80af703e5d05e9b95a72ba104ff6b6a79fe3 100644 (file)
@@ -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",
index 28f9e452336604758f94b4f42d462c720276d408..dd467ef99e8b11adef4cc0551902a02e8ab63bb9 100644 (file)
@@ -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;
index b7eba47f3825acb7e14322fd21250efbcb89c065..13400c778da4866e02600a7ef34f6be2109c0e31 100644 (file)
@@ -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
index 5fc899f6f127f97d14dba6d66e00374cb86bd3da..0af6f854b4a66cbbb598f2cfa02b16178896635e 100644 (file)
@@ -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) << ")");
index 2e8ce9095931c68a610ee81190da5c8ec46c8186..e9731b266ce0b859ca6602961621efb368bc4655 100644 (file)
@@ -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);
 
index 21d89f633862c02f5879e38c739d68a2cecee985..61616c6db95082f36cdfb968847caa17e8806ef3 100644 (file)
@@ -383,24 +383,6 @@ TEST_F(SharedNetwork4ParserTest, relayInfoTests) {
 
     // Create the vector of test scenarios.
     std::vector<RelayTest> 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<RelayTest> 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,
             { }