]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1930] do not mention reservations-out-of-pool when reservations-in-subnet is false
authorRazvan Becheriu <razvan@isc.org>
Fri, 6 Aug 2021 13:53:17 +0000 (16:53 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 12 Aug 2021 11:15:05 +0000 (14:15 +0300)
doc/examples/kea4/all-keys.json
doc/examples/kea4/global-reservations.json
doc/examples/kea4/reservations.json
doc/examples/kea4/shared-network.json
doc/examples/kea6/all-keys.json
doc/examples/kea6/global-reservations.json
doc/examples/kea6/reservations.json
doc/examples/kea6/shared-network.json
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/tests/config_parser_unittest.cc

index 864c1eba19146536e9bc1222065069e4585d54d0..76c4bdd1b3febee9bfb815255153f33c328c78e4 100644 (file)
                 // Specify if server can assume that all reserved addresses
                 // are out-of-pool.
                 // Ignored when reservations-in-subnet is false.
+                // If it is specified, it is inherited to "subnet4" levels.
                 "reservations-out-of-pool": false,
 
                 // List of client classes which must be evaluated when this shared
         // Specify if server can assume that all reserved addresses
         // are out-of-pool.
         // Ignored when reservations-in-subnet is false.
+        // If it is specified, it is inherited to "shared-networks" and
+        // "subnet4" levels.
         "reservations-out-of-pool": false,
 
         // Global compute T1 and T2 timers.
index 1953fc7c4e9b960e54e2c8fe201fdf23b987dba8..3efde9114d9abc4d73ac925fcaa35cbed6c83be4 100644 (file)
@@ -51,7 +51,7 @@
 
 // This directive tells Kea that reservations are global. Note that this
 // can also be specified at shared network and/or subnet level.
-//  "reservation-mode": "global",
+// "reservation-mode": "global",
 // It is replaced by the "reservations-global", "reservations-in-subnet" and
 // "reservations-out-of-pool" parameters.
 
@@ -64,6 +64,7 @@
 // Specify if server can assume that all reserved addresses
 // are out-of-pool.
 // Ignored when reservations-in-subnet is false.
+// If it is specified, it is inherited to "shared-networks" and "subnet4" levels.
   "reservations-out-of-pool": false,
 
 // Define several global host reservations.
index 0b9437cac7de1a5ca4832c6c752ab277ba42f858..c264d3b6448e15ac3c07bafb8915ddc4514bec53 100644 (file)
@@ -81,6 +81,8 @@
         // Specify if server can assume that all reserved addresses
         // are out-of-pool.
         // Ignored when reservations-in-subnet is false.
+        // If it is specified, it is inherited to "shared-networks" and
+        // "subnet4" levels.
         "reservations-out-of-pool": false,
 
         "reservations": [
index 3de7c9379e9d00dfefd1c9a6c4b55916c04bf48a..54caeb56511d44173103394563f77a0cf75579e7 100644 (file)
@@ -79,6 +79,7 @@
             // Specify if server can assume that all reserved addresses
             // are out-of-pool.
             // Ignored when reservations-in-subnet is false.
+            // If it is specified, it is inherited to "subnet4" levels.
             "reservations-out-of-pool": false,
 
             // This starts a list of subnets allowed in this shared network.
index 694942af62b86d3268cc71e7e30416dd3ce81508..13ce6675189b227562f3596ccd7276665aa4cda5 100644 (file)
                 // Specify if server can assume that all reserved addresses
                 // are out-of-pool.
                 // Ignored when reservations-in-subnet is false.
+                // If it is specified, it is inherited to "subnet6" levels.
                 "reservations-out-of-pool": false,
 
                 // List of client classes which must be evaluated when this shared
         // Specify if server can assume that all reserved addresses
         // are out-of-pool.
         // Ignored when reservations-in-subnet is false.
+        // If it is specified, it is inherited to "shared-networks" and
+        // "subnet6" levels.
         "reservations-out-of-pool": false,
 
         // Data directory.
index 6fdb0bee542c1b92f75024f4599043eab140d974..908bc84b228c5401c1062c9fb1e8a19358fa1c5a 100644 (file)
@@ -40,7 +40,7 @@
 
 // This directive tells Kea that reservations are global. Note that this
 // can also be specified at shared network and/or subnet level.
-//  "reservation-mode": "global",
+// "reservation-mode": "global",
 // It is replaced by the "reservations-global", "reservations-in-subnet" and
 // "reservations-out-of-pool" parameters.
 
@@ -53,6 +53,7 @@
 // Specify if server can assume that all reserved addresses
 // are out-of-pool.
 // Ignored when reservations-in-subnet is false.
+// If it is specified, it is inherited to "shared-networks" and "subnet6" levels.
   "reservations-out-of-pool": false,
 
 // Define several global host reservations.
index e860e3ccb426e0f1678c33de22630f40c2484ee7..a4a30ce9937d74107457016e1ce2f2cf8678de7b 100644 (file)
@@ -61,6 +61,8 @@
         // Specify if server can assume that all reserved addresses
         // are out-of-pool.
         // Ignored when reservations-in-subnet is false.
+        // If it is specified, it is inherited to "shared-networks" and
+        // "subnet6" levels.
         "reservations-out-of-pool": false,
 
         "pools": [ { "pool": "2001:db8:1::/120" } ],
index cbec7d321b3b7abcae75d3cfac901dce526dfca8..0b6e7b1eb1a3566b74c94c551aaca98805adbc28 100644 (file)
@@ -84,6 +84,7 @@
             // Specify if server can assume that all reserved addresses
             // are out-of-pool.
             // Ignored when reservations-in-subnet is false.
+            // If it is specified, it is inherited to "subnet6" levels.
             "reservations-out-of-pool": false,
 
             // List of subnets belonging to this particular shared-network
index 7fad50fde1d5ecf64b4dc72fc1313fb7e10d4f78..c381861d60c600eda540e7b97c9570f64d112eaa 100644 (file)
@@ -4739,44 +4739,46 @@ following decision diagram may be useful:
 
 An example configuration that disables reservations looks as follows:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
-       "subnet4": [
-       {
-           "subnet": "192.0.2.0/24",
-           "reservation-mode": "disabled",
-           ...
+   {
+       "Dhcp4": {
+           "subnet4": [
+           {
+               "subnet": "192.0.2.0/24",
+               "reservation-mode": "disabled",
+               "pools": [ { "pool": "192.0.2.10-192.0.2.100" } ]
+           }
+           ]
        }
-       ]
    }
 
-
 An example configuration using global reservations is shown below:
 
-::
-
-   "Dhcp4": {
+.. code-block:: json
 
+   {
+       "Dhcp4": {
 
-       "reservation-mode": "global",
-       "reservations": [
-          {
-           "hw-address": "01:bb:cc:dd:ee:ff",
-           "hostname": "host-one"
-          },
-          {
-           "hw-address": "02:bb:cc:dd:ee:ff",
-           "hostname": "host-two"
-          }
-       ],
+           "reservation-mode": "global",
+           "reservations": [
+              {
+               "hw-address": "01:bb:cc:dd:ee:ff",
+               "hostname": "host-one"
+              },
+              {
+               "hw-address": "02:bb:cc:dd:ee:ff",
+               "hostname": "host-two"
+              }
+           ],
 
-       "subnet4": [
-       {
-           "subnet": "192.0.2.0/24",
-           ...
+           "subnet4": [
+           {
+               "subnet": "192.0.2.0/24",
+               "pools": [ { "pool": "192.0.2.10-192.0.2.100" } ]
+           }
+           ]
        }
-       ]
    }
 
 The meaning of the reservation flags are:
@@ -4802,74 +4804,79 @@ The correspondence of old values are:
 
 ``disabled``:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": false,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": false
+       }
    }
 
 ``global``:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": false,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": false
+       }
    }
 
 ``out-of-pool``:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": true,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": true
+       }
    }
 
 ``all``:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": false
+       }
    }
 
 To activate both ``global`` and ``all``, the following combination can be used:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": false
+       }
    }
 
 To activate both ``global`` and ``out-of-pool``, the following combination can
 be used:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": true,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": true
+       }
    }
 
 Note that enabling ``out-of-pool`` and disabling ``in-subnet`` at the same time
@@ -4881,45 +4888,47 @@ levels.
 
 An example configuration that disables reservations looks as follows:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
-       "subnet4": [
-       {
-           "subnet": "192.0.2.0/24",
-           "reservations-global": false,
-           "reservations-in-subnet": false,
-           ...
+   {
+       "Dhcp4": {
+           "subnet4": [
+           {
+               "subnet": "192.0.2.0/24",
+               "reservations-global": false,
+               "reservations-in-subnet": false
+           }
+           ]
        }
-       ]
    }
 
-
 An example configuration using global reservations is shown below:
 
-::
+.. code-block:: json
 
-   "Dhcp4": {
+   {
+       "Dhcp4": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": false,
-       "reservations": [
-          {
-           "hw-address": "01:bb:cc:dd:ee:ff",
-           "hostname": "host-one"
-          },
-          {
-           "hw-address": "02:bb:cc:dd:ee:ff",
-           "hostname": "host-two"
-          }
-       ],
+           "reservations-global": true,
+           "reservations-in-subnet": false,
+           "reservations": [
+              {
+               "hw-address": "01:bb:cc:dd:ee:ff",
+               "hostname": "host-one"
+              },
+              {
+               "hw-address": "02:bb:cc:dd:ee:ff",
+               "hostname": "host-two"
+              }
+           ],
 
-       "subnet4": [
-       {
-           "subnet": "192.0.2.0/24",
-           ...
+           "subnet4": [
+           {
+               "subnet": "192.0.2.0/24",
+               "pools": [ { "pool": "192.0.2.10-192.0.2.100" } ]
+           }
+           ]
        }
-       ]
    }
 
 For more details regarding global reservations, see :ref:`global-reservations4`.
@@ -5036,8 +5045,9 @@ following can be used:
            # Specify if the server should lookup in-subnet reservations.
            "reservations-in-subnet": false,
            # Specify if the server can assume that all reserved addresses
-           # are out-of-pool.
-           "reservations-out-of-pool": false,
+           # are out-of-pool. It can be ignored because "reservations-in-subnet"
+           # is false.
+           # "reservations-out-of-pool": false,
            "pools": [ { "pool": "10.0.0.10-10.0.0.100" } ]
        } ]
    }
@@ -5147,8 +5157,10 @@ following example:
         # Specify if the server should lookup in-subnet reservations.
         "reservations-in-subnet": false,
         # Specify if the server can assume that all reserved addresses
-        # are out-of-pool.
-        "reservations-out-of-pool": false,
+        # are out-of-pool. It can be ignored because "reservations-in-subnet"
+        # is false, but if it is specified, it is inherited to "shared-networks"
+        # and "subnet4" levels.
+        # "reservations-out-of-pool": false,
         "shared-networks": [{
             "subnet4": [
                 {
index 04c8b20e14ffb1e4bd8dd54df572c7de166a4371..e40ad13995dc04e3a8153d4448739063d2952caa 100644 (file)
@@ -4155,44 +4155,46 @@ following decision diagram may be useful:
 
 An example configuration that disables reservations looks as follows:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
-       "subnet6": [
-       {
-           "subnet": "2001:db8:1::/64",
-           "reservation-mode": "disabled",
-           ...
+   {
+       "Dhcp6": {
+           "subnet6": [
+           {
+               "subnet": "2001:db8:1::/64",
+               "reservation-mode": "disabled",
+               "pools": [ { "pool": "2001:db8:1::-2001:db8:1::100" } ]
+           }
+           ]
        }
-       ]
    }
 
-
 An example configuration using global reservations is shown below:
 
-::
-
-   "Dhcp6": {
+.. code-block:: json
 
+   {
+       "Dhcp6": {
 
-       "reservation-mode": "global",
-       "reservations": [
-          {
-           "duid": "00:03:00:01:11:22:33:44:55:66",
-           "hostname": "host-one"
-          },
-          {
-           "duid": "00:03:00:01:99:88:77:66:55:44",
-           "hostname": "host-two"
-          }
-       ],
+           "reservation-mode": "global",
+           "reservations": [
+              {
+               "duid": "00:03:00:01:11:22:33:44:55:66",
+               "hostname": "host-one"
+              },
+              {
+               "duid": "00:03:00:01:99:88:77:66:55:44",
+               "hostname": "host-two"
+              }
+           ],
 
-       "subnet6": [
-       {
-           "subnet": "2001:db8:1::/64",
-           ...
+           "subnet6": [
+           {
+               "subnet": "2001:db8:1::/64",
+               "pools": [ { "pool": "2001:db8:1::-2001:db8:1::100" } ]
+           }
+           ]
        }
-       ]
    }
 
 The meaning of the reservation flags are:
@@ -4218,74 +4220,79 @@ The correspondence of old values are:
 
 ``disabled``:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": false,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": false
+       }
    }
 
 ``global``:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": false,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": false
+       }
    }
 
 ``out-of-pool``:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": true,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": true
+       }
    }
 
 ``all``:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": false,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": false,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": false
+       }
    }
 
 To activate both ``global`` and ``all``, the following combination can be used:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": false,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": false
+       }
    }
 
 To activate both ``global`` and ``out-of-pool``, the following combination can
 be used:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": true,
-       "reservations-out-of-pool": true,
-       ...
+           "reservations-global": true,
+           "reservations-in-subnet": true,
+           "reservations-out-of-pool": true
+       }
    }
 
 Note that enabling ``out-of-pool`` and disabling ``in-subnet`` at the same time
@@ -4297,45 +4304,47 @@ levels.
 
 An example configuration that disables reservations looks as follows:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
-       "subnet6": [
-       {
-           "subnet": "2001:db8:1::/64",
-           "reservations-global": false,
-           "reservations-in-subnet": false,
-           ...
+   {
+       "Dhcp6": {
+           "subnet6": [
+           {
+               "subnet": "2001:db8:1::/64",
+               "reservations-global": false,
+               "reservations-in-subnet": false
+           }
+           ]
        }
-       ]
    }
 
-
 An example configuration using global reservations is shown below:
 
-::
+.. code-block:: json
 
-   "Dhcp6": {
+   {
+       "Dhcp6": {
 
-       "reservations-global": true,
-       "reservations-in-subnet": false,
-       "reservations": [
-          {
-           "duid": "00:03:00:01:11:22:33:44:55:66",
-           "hostname": "host-one"
-          },
-          {
-           "duid": "00:03:00:01:99:88:77:66:55:44",
-           "hostname": "host-two"
-          }
-       ],
+           "reservations-global": true,
+           "reservations-in-subnet": false,
+           "reservations": [
+              {
+               "duid": "00:03:00:01:11:22:33:44:55:66",
+               "hostname": "host-one"
+              },
+              {
+               "duid": "00:03:00:01:99:88:77:66:55:44",
+               "hostname": "host-two"
+              }
+           ],
 
-       "subnet6": [
-       {
-           "subnet": "2001:db8:1::/64",
-           ...
+           "subnet6": [
+           {
+               "subnet": "2001:db8:1::/64",
+               "pools": [ { "pool": "2001:db8:1::-2001:db8:1::100" } ]
+           }
+           ]
        }
-       ]
    }
 
 For more details regarding global reservations, see :ref:`global-reservations6`.
@@ -4448,8 +4457,9 @@ following can be used:
            # Specify if the server should lookup in-subnet reservations.
            "reservations-in-subnet": false,
            # Specify if the server can assume that all reserved addresses
-           # are out-of-pool.
-           "reservations-out-of-pool": false,
+           # are out-of-pool. It can be ignored because "reservations-in-subnet"
+           # is false.
+           # "reservations-out-of-pool": false,
            "pools": [ { "pool": "2001:db8:1::-2001:db8:1::100" } ]
        } ]
    }
@@ -4559,8 +4569,10 @@ following example:
         # Specify if the server should lookup in-subnet reservations.
         "reservations-in-subnet": false,
         # Specify if the server can assume that all reserved addresses
-        # are out-of-pool.
-        "reservations-out-of-pool": false,
+        # are out-of-pool. It can be ignored because "reservations-in-subnet"
+        # is false, but if it is specified, it is inherited to "shared-networks"
+        # and "subnet6" levels.
+        # "reservations-out-of-pool": false,
         "shared-networks": [{
             "subnet6": [
                 {
index 376f540ab50247a4b460f13e9e246552d24f4978..da9fb9ee9dc8c9fac9e8c4b34112b1e50e062e67 100644 (file)
@@ -6461,8 +6461,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
         "        \"ip-address\": \"5.6.7.8\"\n"
         "    },\n"
         "    \"reservations-global\": false,\n"
-        "    \"reservations-in-subnet\": true,\n"
-        "    \"reservations-out-of-pool\": true,\n"
+        "    \"reservations-in-subnet\": false,\n"
         "    \"renew-timer\": 10,\n"
         "    \"rebind-timer\": 20,\n"
         "    \"valid-lifetime\": 40,\n"
@@ -6489,8 +6488,8 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
         "            \"ip-address\": \"55.66.77.88\"\n"
         "        },\n"
         "        \"reservations-global\": false,\n"
-        "        \"reservations-in-subnet\": false,\n"
-        "        \"reservations-out-of-pool\": false\n"
+        "        \"reservations-in-subnet\": true,\n"
+        "        \"reservations-out-of-pool\": true\n"
         "    }\n"
         "    ]\n"
         " },\n"
@@ -6542,8 +6541,8 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
     EXPECT_EQ("bar", s->getFilename().get());
     EXPECT_TRUE(s->hasRelayAddress(IOAddress("5.6.7.8")));
     EXPECT_FALSE(s->getReservationsGlobal());
-    EXPECT_TRUE(s->getReservationsInSubnet());
-    EXPECT_TRUE(s->getReservationsOutOfPool());
+    EXPECT_FALSE(s->getReservationsInSubnet());
+    EXPECT_FALSE(s->getReservationsOutOfPool());
 
     // For the second subnet, the renew-timer should be 100, because it
     // was specified explicitly. Other parameters a derived
@@ -6561,8 +6560,8 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
     EXPECT_EQ("bootfile.efi", s->getFilename().get());
     EXPECT_TRUE(s->hasRelayAddress(IOAddress("55.66.77.88")));
     EXPECT_FALSE(s->getReservationsGlobal());
-    EXPECT_FALSE(s->getReservationsInSubnet());
-    EXPECT_FALSE(s->getReservationsOutOfPool());
+    EXPECT_TRUE(s->getReservationsInSubnet());
+    EXPECT_TRUE(s->getReservationsOutOfPool());
 
     // Ok, now check the second shared subnet.
     net = nets->at(1);