From: Francis Dupont Date: Fri, 6 Oct 2017 13:11:54 +0000 (+0200) Subject: [master] Finished merge of trac5226 (options with record and array) X-Git-Tag: trac5381_base~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f66951dbda8f62122187ac3a99f0fdcc65b383d8;p=thirdparty%2Fkea.git [master] Finished merge of trac5226 (options with record and array) --- f66951dbda8f62122187ac3a99f0fdcc65b383d8 diff --cc ChangeLog index f1cf9ef367,fe3a2f9879..154303b6be --- a/ChangeLog +++ b/ChangeLog @@@ -1,224 -1,3 +1,232 @@@ ++1307. [func] fdupont ++ When an option is defined with a record type and the array ++ flag is true the last record field is an array. All standard ++ options supported by ISC DHCP and using this are now supported ++ by Kea (so now there is no standard option suported only by ++ ISC DHCP). ++ (Trac #5226, git xxx) ++ +1306. [bug]* marcin + Respective Kea daemons now use their own default configuration + files: kea-dhcp4.conf, kea-dhcp6.conf, kea-dhcp-ddns.conf and + kea-ctrl-agent.conf. This change is aimed at eliminating the + issue whereby 'config-write' command overrides configuration + of all servers rather than just a configuration of the deamon + to which this command has been sent. + (Trac #5338, git 252e5e8a75fa42271b0cdb6edad3c152bbf3c515) + +1305. [bug] tmark + Corrected logic that was causing kea-dhcp4 to remove DNS entries + when renewing leases with generated FQDN names. Prior to this + the server was incorrectly scheduling DNS removal when configured + to generate the client's FQDN. + (Trac #5369, git 18f57f502f1b9fb5bf7ef5ab995ddda60006fd39) + +Kea 1.3.0-beta released on September 29, 2017 + +1304. [bug,func] fdupont + The DHCPv4 Vendor Specific Information (code 43) option and + private options (codes 224-254) can be redefined at the global + scope or inside a client-class. This allows to support different + definitions following the DHCPv4 Vendor Class Identifier (code 60) + option or when defined as a binary option to accept with problems + option 43 carrying a raw value. + (Trac #5073, git b290b3cbaa926d4e9613f6607c5fcbae2301b266) + +1303. [func] tmark + The command handlers in the lease_cmds hook library are now + implemented has hook callouts and registered with the Hooks + manager. Prior to this they were registered as command handlers + with the Command Mgr. + (Trac #5332, git c902bda9f026720f6efbf2e5ad407302aeb5e466) + +1302. [func] marcin, tomek + DHCPv6 server supports shared networks. It allows for grouping + multiple subnets and use them interchangeably to allocate + IP addresses and other resources to a client located on the + particular link. This mechanism is useful to extend an + address space for the client belonging to a particular + subnet and/or to segregate clients being on the same link but + belonging to different classes, e.g. cable modem vs router. + (Trac #5307, git 110d0c9e403af28e6810141f978d9bf55c381f14) + +1301. [func] fdupont + Added some standard option definitions which are supported + by ISC DHCP but not (yet) by Kea. + (Trac #5227, git 4bef838245f08fca5f2cf037cd3a75278b77f8f9) + +1300. [doc] tomek + Documentation for shared networks added. + (Trac #5310, git 41fd3bb7ed2f4cd15db6cbd14713f4474f659c92) + +1299. [doc] fdupont, tmark + Added an example stunnel configuration file to demonstrate + using kea-shell through https. + (Trac #5282, git efe044fa90d53398e215d2bf31e00e83353e8774) + +1298. [func] marcin, tomek + DHCPv4 server supports shared networks. It allows for grouping + multiple subnets and use them interchangeably to allocate + IP addresses and other resources to a client located on the + particular link. This mechanism is useful to extend an + address space for the client belonging to a particular + subnet and/or to segregate clients being on the same link but + belonging to different classes, e.g. cable modem vs router. + (Trac #5306, git 4f2fca69be32997c718ab2c7f37ac80ed4e41d15) + +1297. [func] tmark + Added a hook point, "command-processed", to kea-dhcp4 + and kea-dhcp6 servers. This hook point occurs after + a control channel command has been received and + processed. + (Trac #5111, git 043d17b0688d4ab25b12469d27859983cb297d07) + +1296. [bug] tmark + Altered the mysql backend logic to disable auto_reconnect and + set session value of wait_timeout to a very large values. This + avoids a segfault in MySQL client library caused by auto-reconnects + occurring when kea server's MySQL connection is idle for longer + than the global MySQL wait_timeout. + (Trac #5354, git 9881ef6d772f27de82c048e198ba0ff9e71b9351) + +1295. [bug] tomek + DHCPv4 and DHCPv6 servers are now able to parse shared networks. + A basic shared networks examples added. + (Trac #5357, git 74b824cc80f8be66084308c0bf12c1a71f311915) + +1294. [func] marcin + Implemented data structures holding configuration of shared + networks. The new structures are unused until remaining tickets + for shared networks implementation are completed. + (Trac #5305, git 76dd46f7070c141cc89d772d69a897b67bd179a1) + +1293. [func] tomek + DHCP4_BUFFER_WAIT, DHCP4_BUFFER_WAIT_INTERRUPTED, DHCP6_BUFFER_WAIT, + and DHCP6_BUFFER_WAIT_INTERRUPTED logging messages are no longer + emitted. + (Trac #5345, git 779040fa399fb2da271569dc315294463e28f852) + +1292. [func] tomek + User contexts are now supported for subnets. This adds a new + functionality, but also makes the existing documentation example + correct. + (Trac #5350, git 828ecb6dbdaaedd97d2af79dfa9b7f4845d3a049) + +1291. [func] fdupont + The configuration parser now checks for mandatory parameters that + are missing. + (Trac #5124, git af0f3d50a835f64a5f8a47c47ef464b119a49643) + +1290. [bug] marcin + Corrected a bug causing illegal memory access while + retrieving server hostname and boot file name fields from + the host reservation database. Many thanks to Juan Settecase + for his assistance in identifying this issue. + (Trac #5340, git 2fdc7efcb862ced3c1054620bf14e75a0db6aed2) + +1289. [bug] marcin, tmark + Corrected handling of EAGAIN and EWOULDLBOCK errors in + UnixDomainSocket. This was causing intermittent command + channel write errors in kea-ctrl-agent on some Debian systems. + (Trac #5336, git db251cb66ad77ba28ab44281323ddeb23cf29506) + +1288. [func] marcin + Documented subnet_cmds library in the Kea User's Guide. Also moved + several classes from dhcp<4/6> into lib/dhcpsrv to facilitate subnet + command parsing. + (Trac #5315, git d259f330a1690b20eb368f6252f5da2cdb6187de) + +1287. [bug] tmark + Logger configuration now correctly uses maxsize and maxver + parameters, allowing log rotation to function properly. Prior to + this these values were not being propagated downward, causing log + rotation to always be disabled. The defaults for maxsize and + maxver are 10Mb and 1 respectively. + (Trac #5324, git 75f148458bdeeed27eb877cc2c3ce3069b152f38) + +1286. [func] marcin + Configured subnets are now indexed by subnet identifier and + prefix for faster subnet lookups in the configuration. + (Trac #5314, git 894aeb048b7281f947f87a5d6dc5112fac4a86fb) + +1285. [func] tomek + Several new commands implemented in lease_cmds library: + lease4-del, lease6-del, lease4-update, lease6-update, + lease4-wipe and lease6-wipe that allow deleting and updating + leases and also wipe all leases from a specific subnet. + (Trac #5280, #5281, 94ff2448c8cf6e3321f4d1b3666a2e2b736f6c50) + +1284. [func] tomek + A new library, lease_cmds, has been implemented. Its intended + purpose is to support commands for lease management. Currently + supported commands are: lease4-add, lease6-add, lease4-get, + lease6-get. Additional commands and documentation are planned. + (Trac #5272, #5279, git 785c2e521b198a03d26bde4a804638bfc19ce91b) + +1283. [func] fdupont + An 'always-send' parameter has been added to options + configuration. It allows an option to be always sent, even if + a client didn't request it. + (Trac #5241, git cef2b630c720a442710efc0d1615b7c7bce01e54) + +1282. [bug] fdupont + Now all interface service sockets are closed before interface + re-detection. Note if the re-configuration fails they remain + closed. + (Trac #5333, git 8bff2ec336456de51d0d9d3ff011d28a6a61ef66) + +1281. [build] tmark + Configure script now correctly recognizes static boost_system + library as well as checks for the presence of static glibc static + libraries when --enable-satic-link is specified. + (Trac #5337, git 42548148cbeaaa285519e121f493d52607f1e8a0) + +1280. [build] waltsteverson + Missing header for PD-exclude DHCPv6 option is now installed. + (Github #51, git 36a8e1b8f687a6398af8a10f241e8d19e9de33d8) + +1279. [build] waltsteverson + Compilation fixes for Alpine Linux + (Github #50, git 824afa63354e045a5e4f6437246c329d359e04dd) + +1278. [doc] jsoref + Many spelling corrections. + (Github #52, git 1dcaef6f8e7901d628c8638fc2f8145ac0279586) + +1277. [func]* marcin + Added support to Command Manager to process commands using + callouts implemented within hooks libraries. + (Trac #5330, git 8041d177ed5587101ecb47a09820a7e67e42a066) + +1276. [build] tmark + The configure script now configures the build to require the Boost + system library (boost_system) by default. The library must be + installed and you may need to specify "--with-boost-lib-dir=". + Prior to this the default was to attempt to build Boost with headers + only. Building with headers only may still be done, though it is + strongly discouraged, by specifying "--enable-boost-headers-only". + (Trac #5215, git b6f1ee0d1210e35631369fc697c76cc3cf2c4130) + +1275. [func] marcin + LibraryHandle object can now be used to register handlers + for the control commands in a hook library. + (Trac #5329, git 966cc24ae5593ebb08d6f02a11dab23463ebad7e) + +1274. [func] marcin + It is now possible to manage Control Agent with keactrl. + (Trac #5108, git 53ba9f8197a25abd2c52ee3f5e95bc4e4be0241f) + +1273. [doc] marcin + Documented in the User's Guide that the server terminates + when database connection is lost. + (Trac #5320, git 5c8b277e8041b53b27a87b32d162ab41ef8b43d7) + +1272. [bug] marcin + Fixed inefficient leases indexing in the memfile lease + manager causing increased CPU utilization during lease + searches. + (Trac #5328, git 23b490414f5575b252c8c42fbe93ad2c57d47953) + 1271. [doc] marcin Documented how to setup secure connection to the Kea control channel. diff --cc src/bin/dhcp4/tests/get_config_unittest.cc index 5c6cdb1635,a4ed05c508..67cd8b2b9d --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@@ -4102,7 -4113,89 +4132,92 @@@ const char* UNPARSED_CONFIGS[] = " },\n" " \"option-data\": [\n" " {\n" +" \"always-send\": false,\n" + " \"code\": 78,\n" + " \"csv-format\": true,\n" + " \"data\": \"true, 10.0.0.3, 127.0.0.1\",\n" + " \"name\": \"slp-directory-agent\",\n" + " \"space\": \"dhcp4\"\n" + " },\n" + " {\n" ++" \"always-send\": false,\n" + " \"code\": 79,\n" + " \"csv-format\": true,\n" + " \"data\": \"false, \",\n" + " \"name\": \"slp-service-scope\",\n" + " \"space\": \"dhcp4\"\n" + " }\n" + " ],\n" + " \"option-def\": [ ],\n" ++" \"shared-networks\": [ ],\n" + " \"subnet4\": [\n" + " {\n" + " \"4o6-interface\": \"\",\n" + " \"4o6-interface-id\": \"\",\n" + " \"4o6-subnet\": \"\",\n" + " \"id\": 1,\n" -" \"interface\": \"\",\n" + " \"match-client-id\": true,\n" + " \"next-server\": \"0.0.0.0\",\n" + " \"option-data\": [ ],\n" + " \"pools\": [\n" + " {\n" + " \"option-data\": [ ],\n" + " \"pool\": \"192.0.2.1-192.0.2.100\"\n" + " }\n" + " ],\n" + " \"rebind-timer\": 2000,\n" + " \"relay\": {\n" + " \"ip-address\": \"0.0.0.0\"\n" + " },\n" + " \"renew-timer\": 1000,\n" + " \"reservation-mode\": \"all\",\n" + " \"reservations\": [ ],\n" + " \"subnet\": \"192.0.2.0/24\",\n" + " \"valid-lifetime\": 4000\n" + " }\n" + " ]\n" + " }\n", + // CONFIGURATION 33 + "{\n" + " \"decline-probation-period\": 86400,\n" + " \"dhcp-ddns\": {\n" + " \"always-include-fqdn\": false,\n" + " \"enable-updates\": false,\n" + " \"generated-prefix\": \"myhost\",\n" + " \"max-queue-size\": 1024,\n" + " \"ncr-format\": \"JSON\",\n" + " \"ncr-protocol\": \"UDP\",\n" + " \"override-client-update\": false,\n" + " \"override-no-update\": false,\n" + " \"qualifying-suffix\": \"\",\n" + " \"replace-client-name\": \"never\",\n" + " \"sender-ip\": \"0.0.0.0\",\n" + " \"sender-port\": 0,\n" + " \"server-ip\": \"127.0.0.1\",\n" + " \"server-port\": 53001\n" + " },\n" + " \"dhcp4o6-port\": 0,\n" + " \"echo-client-id\": true,\n" + " \"expired-leases-processing\": {\n" + " \"flush-reclaimed-timer-wait-time\": 25,\n" + " \"hold-reclaimed-time\": 3600,\n" + " \"max-reclaim-leases\": 100,\n" + " \"max-reclaim-time\": 250,\n" + " \"reclaim-timer-wait-time\": 10,\n" + " \"unwarned-reclaim-cycles\": 5\n" + " },\n" + " \"hooks-libraries\": [ ],\n" + " \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n" + " \"interfaces-config\": {\n" + " \"interfaces\": [ \"*\" ],\n" + " \"re-detect\": false\n" + " },\n" + " \"lease-database\": {\n" + " \"type\": \"memfile\"\n" + " },\n" + " \"option-data\": [\n" + " {\n" ++" \"always-send\": false,\n" " \"code\": 1,\n" " \"csv-format\": true,\n" " \"data\": \"1234\",\n" @@@ -4138,10 -4230,9 +4253,10 @@@ " \"type\": \"ipv4-address\"\n" " }\n" " ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 33 + // CONFIGURATION 34 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@@ -4463,10 -4548,9 +4578,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 37 + // CONFIGURATION 38 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@@ -4506,10 -4590,9 +4621,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 38 + // CONFIGURATION 39 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@@ -5142,10 -5223,9 +5257,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 44 + // CONFIGURATION 45 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@@ -5185,10 -5265,9 +5300,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 45 + // CONFIGURATION 46 "{\n" " \"decline-probation-period\": 12345,\n" " \"dhcp-ddns\": {\n" @@@ -5228,10 -5307,9 +5343,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 46 + // CONFIGURATION 47 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@@ -5271,10 -5349,9 +5386,10 @@@ " },\n" " \"option-data\": [ ],\n" " \"option-def\": [ ],\n" +" \"shared-networks\": [ ],\n" " \"subnet4\": [ ]\n" " }\n", - // CONFIGURATION 47 + // CONFIGURATION 48 "{\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" diff --cc src/lib/dhcp/std_option_defs.h index 2afa6ff4c4,d0fb93f84d..560d6f3c8c --- a/src/lib/dhcp/std_option_defs.h +++ b/src/lib/dhcp/std_option_defs.h @@@ -62,9 -65,15 +65,15 @@@ RECORD_DECL(VIVCO_RECORDS, OPT_UINT32_T // // Three 1 byte fields to describe a network interface: type, major and minor RECORD_DECL(CLIENT_NDI_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE, OPT_UINT8_TYPE); -// A client identifer: a 1 byte type field followed by opaque data depending on the type +// A client identifier: a 1 byte type field followed by opaque data depending on the type RECORD_DECL(UUID_GUID_RECORDS, OPT_UINT8_TYPE, OPT_BINARY_TYPE); + // RFC6731 DHCPv4 Recursive DNS Server Selection option. + // + // Flag, two addresses and domain list + RECORD_DECL(V4_RDNSS_SELECT_RECORDS, OPT_UINT8_TYPE, OPT_IPV4_ADDRESS_TYPE, + OPT_IPV4_ADDRESS_TYPE, OPT_FQDN_TYPE); + // RFC7618 DHCPv4 Port Parameter option. // // PSID offset, PSID-len and PSID