From: Razvan Becheriu Date: Wed, 18 Nov 2020 09:32:37 +0000 (+0200) Subject: [#1405] addressed comments X-Git-Tag: Kea-1.9.2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a694f0e5b86c33cf2e0526d53305bc4295d932e8;p=thirdparty%2Fkea.git [#1405] addressed comments --- diff --git a/doc/examples/kea4/all-keys.json b/doc/examples/kea4/all-keys.json index 19d0b1ac7d..2182a61a8b 100644 --- a/doc/examples/kea4/all-keys.json +++ b/doc/examples/kea4/all-keys.json @@ -695,10 +695,10 @@ // Enumeration specifying server's mode of operation when it // fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and "reservations-out-of-pool" // parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, @@ -871,10 +871,10 @@ // Enumeration specifying server's mode of operation when it // fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and // "reservations-out-of-pool" parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, @@ -1012,9 +1012,9 @@ }, // Fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and "reservations-out-of-pool" parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, diff --git a/doc/examples/kea4/global-reservations.json b/doc/examples/kea4/global-reservations.json index 155b56aeea..fa3180207b 100644 --- a/doc/examples/kea4/global-reservations.json +++ b/doc/examples/kea4/global-reservations.json @@ -51,7 +51,19 @@ // 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. + +// Specify if server should lookup global reservations. + "reservations-global": true, + +// Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": false, + +// Specify if server can assume that all reserved addresses +// are out-of-pool. + "reservations-out-of-pool": false, // Define several global host reservations. "reservations": [ @@ -62,10 +74,10 @@ // the global scope: as it breaks the link between the reservation and // the subnet it can lead to a client localized in another subnet than // its address belongs to. - { - "hw-address": "1a:1b:1c:1d:1e:1f", - "ip-address": "192.0.2.201" - }, + { + "hw-address": "1a:1b:1c:1d:1e:1f", + "ip-address": "192.0.2.201" + }, // This is a reservation for a specific client-id. It also shows // the this client will get a reserved hostname. A hostname can be defined @@ -136,13 +148,13 @@ ], // Define a subnet. - "subnet4": [ - { - "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ], - "subnet": "192.0.2.0/24", - "interface": "eth0" - } - ], + "subnet4": [ + { + "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ], + "subnet": "192.0.2.0/24", + "interface": "eth0" + } + ], // The following configures logging. It assumes that messages with at // least informational level (info, warn, error and fatal) should be diff --git a/doc/examples/kea4/reservations.json b/doc/examples/kea4/reservations.json index 61b18bd8b4..71d346505a 100644 --- a/doc/examples/kea4/reservations.json +++ b/doc/examples/kea4/reservations.json @@ -51,6 +51,8 @@ // To avoid this check, one can change reservation-mode to out-of-pool, rather // than 'all'. If a subnet does not have reservations at all, the reservation // lookup can be skipped altogether (reservation-mode is set to 'disabled'). +// The reservation-mode has been replaced by reservations-global, +// reservations-in-subnet and reservations-out-of-pool. // Note that the second reservation is for an address which is within the // range of the pool of the dynamically allocated address. The server will @@ -66,7 +68,13 @@ // out of the dynamic pool and change reservation-mode to "out-of-pool". // Kea will then be able to skip querying for host reservations when // assigning leases from dynamic pool. - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", "reservations-in-subnet" + // and "reservations-out-of-pool" parameters. + "reservations-in-subnet": true, + + "reservations-out-of-pool": false, + "reservations": [ // This is a reservation for a specific hardware/MAC address. It's a very diff --git a/doc/examples/kea4/shared-network.json b/doc/examples/kea4/shared-network.json index 397869fd6e..4fc95cee53 100644 --- a/doc/examples/kea4/shared-network.json +++ b/doc/examples/kea4/shared-network.json @@ -64,7 +64,21 @@ // Timer values can be overridden here. "renew-timer": 100, - "reservation-mode": "all", + + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + + // Specify if server should lookup global reservations. + "reservations-global": false, + + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, // This starts a list of subnets allowed in this shared network. // In our example, there are two subnets. @@ -86,7 +100,17 @@ "ip-address": "0.0.0.0" }, "renew-timer": 10, - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + // Specify if server should lookup global reservations. + "reservations-global": false, + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, "subnet": "10.0.0.0/8", "valid-lifetime": 30 }, @@ -100,7 +124,17 @@ "pools": [ ], "rebind-timer": 20, "renew-timer": 10, - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + // Specify if server should lookup global reservations. + "reservations-global": false, + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, "subnet": "192.0.2.0/24", "valid-lifetime": 30 } diff --git a/doc/examples/kea6/all-keys.json b/doc/examples/kea6/all-keys.json index da08911928..b7b9cc5624 100644 --- a/doc/examples/kea6/all-keys.json +++ b/doc/examples/kea6/all-keys.json @@ -653,10 +653,10 @@ // Enumeration specifying server's mode of operation when it // fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and "reservations-out-of-pool" // parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, @@ -852,10 +852,10 @@ // Enumeration specifying server's mode of operation when it // fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and // "reservations-out-of-pool" parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, @@ -990,9 +990,9 @@ }, // Fetches host reservations. + // "reservation-mode": "all", // It is replaced by the "reservations-global", // "reservations-in-subnet" and "reservations-out-of-pool" parameters. - // "reservation-mode": "all", // Specify if server should lookup global reservations. "reservations-global": false, diff --git a/doc/examples/kea6/global-reservations.json b/doc/examples/kea6/global-reservations.json index b5674178c1..519c7ca7d9 100644 --- a/doc/examples/kea6/global-reservations.json +++ b/doc/examples/kea6/global-reservations.json @@ -36,14 +36,26 @@ // costly database lookup to do so. It is therefore useful from a performance // perspective to use only the reservation types that are actually used in a // given network. - "host-reservation-identifiers": [ "duid", "hw-address", "flex-id" ], + "host-reservation-identifiers": [ "duid", "hw-address", "flex-id" ], // 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. + +// Specify if server should lookup global reservations. + "reservations-global": true, + +// Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": false, + +// Specify if server can assume that all reserved addresses +// are out-of-pool. + "reservations-out-of-pool": false, // Define several global host reservations. - "reservations": [ + "reservations": [ // This is a simple host reservation. The host with DUID matching // the specified value will get an address of 2001:db8:1::100. @@ -113,11 +125,11 @@ // quotes. // Note: flexible identifier requires flex_id hook library to be // loaded to work. - { - "flex-id": "'somevalue'", - "ip-addresses": [ "2001:db8:1:cafe::2" ] - } - ], + { + "flex-id": "'somevalue'", + "ip-addresses": [ "2001:db8:1:cafe::2" ] + } + ], // The following list defines subnets. Subnet, pools and interface definitions // are the same as in the regular scenario. diff --git a/doc/examples/kea6/reservations.json b/doc/examples/kea6/reservations.json index dad59d4f1e..27d1bf6cab 100644 --- a/doc/examples/kea6/reservations.json +++ b/doc/examples/kea6/reservations.json @@ -48,7 +48,12 @@ // out of the dynamic pool and change reservation-mode to "out-of-pool". // Kea will then be able to skip querying for host reservations when // assigning leases from dynamic pool. - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", "reservations-in-subnet" + // and "reservations-out-of-pool" parameters. + "reservations-in-subnet": true, + + "reservations-out-of-pool": false, "pools": [ { "pool": "2001:db8:1::/120" } ], diff --git a/doc/examples/kea6/shared-network.json b/doc/examples/kea6/shared-network.json index a8a537e36f..992a0d0350 100644 --- a/doc/examples/kea6/shared-network.json +++ b/doc/examples/kea6/shared-network.json @@ -69,7 +69,21 @@ "ip-address": "2001:db8::1" }, "renew-timer": 100, - "reservation-mode": "all", + + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + + // Specify if server should lookup global reservations. + "reservations-global": false, + + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, // List of subnets belonging to this particular shared-network // start here. @@ -85,7 +99,17 @@ "ip-address": "2001:db8:1::123" }, "renew-timer": 10, - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + // Specify if server should lookup global reservations. + "reservations-global": false, + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, "subnet": "2001:db8:1::/64", "pools": [ { "pool": "2001:db8:1:abcd::/64" } ], "valid-lifetime": 40 @@ -101,7 +125,17 @@ "ip-address": "3000::1" }, "renew-timer": 10, - "reservation-mode": "all", + // "reservation-mode": "all", + // It is replaced by the "reservations-global", + // "reservations-in-subnet" and "reservations-out-of-pool" + // parameters. + // Specify if server should lookup global reservations. + "reservations-global": false, + // Specify if server should lookup in-subnet reservations. + "reservations-in-subnet": true, + // Specify if server can assume that all reserved addresses + // are out-of-pool. + "reservations-out-of-pool": false, "subnet": "3000::/16", "valid-lifetime": 40 } diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 889907c655..ccfa6d48b8 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -4538,7 +4538,6 @@ following decision diagram: :: - O | v @@ -4740,7 +4739,8 @@ configuration, as ``out-of-pool`` are also ``in-subnet``. } -For this reason, the ``in-subnet`` can not be omitted when ``out-of-pool`` is set. +For this reason, the ``in-subnet`` must not be disabled or it can be enabled +explicitly when ``out-of-pool`` is enabled. :: diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 30492c2dd4..a95b72a40d 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -4185,7 +4185,8 @@ configuration, as ``out-of-pool`` are also ``in-subnet``. } -For this reason, the ``in-subnet`` can not be omitted when ``out-of-pool`` is set. +For this reason, the ``in-subnet`` must not be disabled or it can be enabled +explicitly when ``out-of-pool`` is enabled. :: diff --git a/doc/sphinx/arm/hooks.rst b/doc/sphinx/arm/hooks.rst index 358d6c5683..36f65e9097 100644 --- a/doc/sphinx/arm/hooks.rst +++ b/doc/sphinx/arm/hooks.rst @@ -2655,9 +2655,9 @@ An example response could look as follows: "ip-address": "0.0.0.0" }, "renew-timer": 60, + # "reservation-mode": "all", # It is replaced by the "reservations-global" # "reservations-in-subnet" and "reservations-out-of-pool" parameters. - # "reservation-mode": "all", # Specify if server should lookup global reservations. "reservations-global": false, # Specify if server should lookup in-subnet reservations. diff --git a/src/bin/dhcp4/tests/dora_unittest.cc b/src/bin/dhcp4/tests/dora_unittest.cc index 3ea2529a98..ce2405a19f 100644 --- a/src/bin/dhcp4/tests/dora_unittest.cc +++ b/src/bin/dhcp4/tests/dora_unittest.cc @@ -1801,7 +1801,7 @@ TEST_F(DORATest, reservationsWithConflicts) { } // This test verifies that the allocation engine ignores reservations when -// reservation-mode is set to "disabled". +// reservations flags are set to "disabled". TEST_F(DORATest, reservationModeDisabled) { // Client has a reservation. Dhcp4Client client(Dhcp4Client::SELECTING);