From: Francis Dupont Date: Mon, 13 Mar 2023 00:13:23 +0000 (+0100) Subject: [#719] Updated doc & co X-Git-Tag: Kea-2.3.6~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb432a3c6a9f31bf46b7bc0a75330e5ffc5389b0;p=thirdparty%2Fkea.git [#719] Updated doc & co --- diff --git a/doc/examples/kea4/all-keys-netconf.json b/doc/examples/kea4/all-keys-netconf.json index 8aa6366904..cc33a6650a 100644 --- a/doc/examples/kea4/all-keys-netconf.json +++ b/doc/examples/kea4/all-keys-netconf.json @@ -547,7 +547,7 @@ "option-data": [ { // Boolean flag indicating if the given option is always - // send in response or only when requested. The default + // sent in response or only when requested. The default // value of false indicates that it is only sent when // requested. "always-send": false, @@ -569,7 +569,7 @@ "name": "domain-name-servers", // Boolean flag indicating if the given option is never - // send in response. The default value of false indicates + // sent in response. The default value of false indicates // that it is sent when it should. When true the option // is not sent despite of any other setting, i.e. it is // a final flag. @@ -898,7 +898,7 @@ "name": "routers", // Boolean flag indicating if the given option is never - // send in response. + // sent in response. "never-send": false, // Option space. The default value "dhcp4" designates the diff --git a/doc/examples/kea4/all-keys.json b/doc/examples/kea4/all-keys.json index ccf01dde1f..401feb6ee8 100644 --- a/doc/examples/kea4/all-keys.json +++ b/doc/examples/kea4/all-keys.json @@ -583,7 +583,7 @@ "option-data": [ { // Boolean flag indicating if the given option is always - // send in response or only when requested. The default + // sent in response or only when requested. The default // value of false indicates that it is only sent when // requested. "always-send": false, @@ -605,7 +605,7 @@ "name": "domain-name-servers", // Boolean flag indicating if the given option is never - // send in response. The default value of false indicates + // sent in response. The default value of false indicates // that it is sent when it should. When true the option // is not sent despite of any other setting, i.e. it is // a final flag. @@ -942,7 +942,7 @@ "name": "routers", // Boolean flag indicating if the given option is never - // send in response. + // sent in response. "never-send": false, // Option space. The default value "dhcp4" designates the diff --git a/doc/examples/kea6/all-keys-netconf.json b/doc/examples/kea6/all-keys-netconf.json index 990adf4a6d..148b6ec99e 100644 --- a/doc/examples/kea6/all-keys-netconf.json +++ b/doc/examples/kea6/all-keys-netconf.json @@ -463,7 +463,7 @@ "option-data": [ { // Boolean flag indicating if the given option is always - // send in response or only when requested. The default + // sent in response or only when requested. The default // value of false indicates that it is only sent when // requested. "always-send": false, @@ -485,7 +485,7 @@ "name": "dns-servers", // Boolean flag indicating if the given option is never - // send in response. The default value of false indicates + // sent in response. The default value of false indicates // that it is sent when it should. When true the option // is not sent despite of any other setting, i.e. it is // a final flag. @@ -837,7 +837,7 @@ "name": "preference", // Boolean flag indicating if the given option is never - // send in response. + // sent in response. "never-send": false, // Option space. The default value "dhcp6" designates the diff --git a/doc/examples/kea6/all-keys.json b/doc/examples/kea6/all-keys.json index 81e113c309..74c7a60f8c 100644 --- a/doc/examples/kea6/all-keys.json +++ b/doc/examples/kea6/all-keys.json @@ -497,7 +497,7 @@ "option-data": [ { // Boolean flag indicating if the given option is always - // send in response or only when requested. The default + // sent in response or only when requested. The default // value of false indicates that it is only sent when // requested. "always-send": false, @@ -519,7 +519,7 @@ "name": "dns-servers", // Boolean flag indicating if the given option is never - // send in response. The default value of false indicates + // sent in response. The default value of false indicates // that it is sent when it should. When true the option // is not sent despite of any other setting, i.e. it is // a final flag. @@ -887,7 +887,7 @@ "name": "preference", // Boolean flag indicating if the given option is never - // send in response. + // sent in response. "never-send": false, // Option space. The default value "dhcp6" designates the diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 149988a298..c308fe0eec 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -1486,14 +1486,15 @@ Parameter Request List option (or its equivalent for vendor options): } -The ``domain-name-servers`` option is always added to responses (the -always-send is "sticky"), but the value is the subnet one when the client -is localized in the subnet. +In the example above, the ``domain-name-servers`` option respects the global +``always-send`` flag and is always added to responses, but for subnet +``192.0.3.0/24``, the value is taken from the subnet-level option data +specification. At the opposite of ``always-send`` if the ``never-send`` flag is set to ``true`` for a particular option the server does not add it to the response. The effect is the same as if the client removed the option code in the -Parameter Request List option Option (or its equivalent for vendor options): +Parameter Request List option (or its equivalent for vendor options): :: @@ -1522,9 +1523,9 @@ Parameter Request List option Option (or its equivalent for vendor options): ... } -The ``domain-name-servers`` option is never added to responses (the -never-send is "sticky" too). The ``never-send`` is as the precedence -over ``always-send`` so if both are true the option is not added. +In the example above, ``domain-name-servers`` option is never added to +responses on subnet ``192.0.3.0/24``. ``never-send`` has precedence over +``always-send`` so if both are true the option is not added. .. note:: diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 594d6c4aaf..a9ec10132b 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -1413,9 +1413,10 @@ Option Request Option (or its equivalent for vendor options), as in: } -The ``dns-servers`` option is always added to responses (the always-send is -"sticky"), but the value is the subnet one when the client is localized -in the subnet. +In the example above, the ``dns-servers`` option respects the global +``always-send`` flag and is always added to responses, but for subnet +``2001:db8:1::/64``, the value is taken from the subnet-level option data +specification. At the opposite of ``always-send`` if the ``never-send`` flag is set to ``true`` for a particular option the server does not add it to the response. @@ -1449,9 +1450,9 @@ Option Request Option (or its equivalent for vendor options), as in: ... } -The ``dns-server`` option is never added to responses (the never-send is -"sticky" too). The ``never-send`` is as the precedence over ``always-send`` -so if both are true the option is not added. +In the example above, the ``dns-server`` option is never added to responses +on subnet ``2001:db8:1::/64``. ``never-send`` has precedence over +``always-send`` so if both are true the option is not added. .. note:: diff --git a/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy index 98c8d3c4cb..e39c35ed6f 100644 --- a/src/bin/dhcp4/dhcp4_parser.yy +++ b/src/bin/dhcp4/dhcp4_parser.yy @@ -1996,8 +1996,8 @@ option_data_space: space; option_data_csv_format: CSV_FORMAT COLON BOOLEAN { ctx.unique("csv-format", ctx.loc2pos(@1)); - ElementPtr space(new BoolElement($3, ctx.loc2pos(@3))); - ctx.stack_.back()->set("csv-format", space); + ElementPtr csv(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("csv-format", csv); }; option_data_always_send: ALWAYS_SEND COLON BOOLEAN { @@ -2008,8 +2008,8 @@ option_data_always_send: ALWAYS_SEND COLON BOOLEAN { option_data_never_send: NEVER_SEND COLON BOOLEAN { ctx.unique("never-send", ctx.loc2pos(@1)); - ElementPtr persist(new BoolElement($3, ctx.loc2pos(@3))); - ctx.stack_.back()->set("never-send", persist); + ElementPtr cancel(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("never-send", cancel); }; // ---- pools ------------------------------------