From: Francis Dupont Date: Wed, 21 Oct 2015 12:55:17 +0000 (+0200) Subject: [master] Finished merge of trac4058 (DHCPv4 Subnet Selection option) X-Git-Tag: fdfb_base~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7072884e8ce74dc64cd74e101d81e5c0763f492;p=thirdparty%2Fkea.git [master] Finished merge of trac4058 (DHCPv4 Subnet Selection option) --- b7072884e8ce74dc64cd74e101d81e5c0763f492 diff --cc ChangeLog index 8f7f3b1c53,55a5314272..8aa3ba726b --- a/ChangeLog +++ b/ChangeLog @@@ -1,165 -1,3 +1,169 @@@ ++1034. [func] fdupont ++ Add support for DHCPv4 subnet selection option. ++ (Trac #4058, git xxx) ++ +1033. [bug] stephen + Updated OutputBuffer class to address warnings from Coverity. + (Trac #3443, git 4bf0a14aa7a1303ed6959127c5354687e9f222ba) + +1032. [func] marcin + PostgreSQL lease database backend has been extended with new + functions to obtain expired leases and to delete expired + reclaimed leases. + (Trac #3968, git 0bc02588d8553ba9a4fc749115a3e370407d7287) + +1031. [build] fdupont + Rewrote the system_messages tool from Python to C++. + (trac #3516, git a8195310c641027d1822344cafad64e6f695d614) + +1030. [bug] marcin + Fixed failing 'reclaimExpiredLeasesTimeout' unit tests on + some virtual machines. + (trac #4075, git c3a2487f53ecf69edc0a38f574fce17c4332162c) + +1029. [func] tomek + A new hook point lease6_decline has been added. It is called when + the DHCPv6 server is about to decline a lease as a result of + processing incoming DECLINE message. + (Trac #3986, git b6e3f1bbe3595aeba769d627d571e2eeee38a397) + +1028. [func] marcin + Expired leases are processed periodically according to the + server configuration. + (Trac #3975, git 3bd8891c0b9cb7dc504fa69251610996775cefbf) + +1027. [func] tomek + Expired declined IPv6 leases can now be reclaimed (returned to the + available pool) after probation period elapses. + (Trac #3985, git 9aadfa902d898ce1f52b773152a5b34519a9a9fe) + +1026. [doc] stephen + Added documentation for the kea-dhcp4.commands and + kea-dhcp6.commands loggers. + (Trac #3952, git 3eb5d3185683e05494c1d84ed7195627fce4b6c1) + +1025. [func] tomek + A new hook point lease4_decline has been added. It is called when + the DHCPv4 server is about to decline a lease as a result of + processing incoming DHCPDECLINE message. + (Trac #3986, git 39bde93fe25e4aff52623d4df7fd55c64e0a9c21) + +1024. [func]* tomek + Boolean Skip flag in Hooks API has been replaced by enum status. + This is backward incompatible change if you developed hook + library that takes advantage of the skip flag. See Hooks + Developer Guide for easy steps necessary for migration. + (Trac #3499, git 99ca398d4d042a098b5c491368733220db8cdd08) + +1023. [func] tmark + kea-admin now supports upgrading from MySQL schema version 3.0 + to 4.0. In addition, the lease6 data dump now contains the + text label for lease_hwaddr_source column rather than its + numeric value. + (Trac #3967, git 2e13ac3b0b278faabe338b00ffee8259c13f5342) + +1022. [func] fdupont + Added support for the V4 link selection sub-option (RFC 3527). If + present in an incoming packet, the server will allocate an address + in the subnet identified in the option. If this is impossible, no + address will be allocated and the request refused. + (Trac #4057, git 8c02cec5ec8e311a9d23fd582d8e9e8647667abb) + +1021. [bug] stephen + Added missing address parameter to ALLOC_ENGINE_V4_REQUEST_OUT_OF_POOL + message. + (Trac #3996, git 680233550747209a1707e8f920179479b980aa2a) + +1020. [func] kalmus + A general purpose base class for MySQL connection has been + implemented. + (Trac #3681, git 884d8bb4a55d3d7b1b8f3f01efb312bd8dec399b) + +1019. [func] marcin + Added new configuration parameters controlling processing of the + expired leases in the DHCPv4 and DHCPv6 server. + (Trac #3974, git c998d36c40cc46ffe9f888e615bbcfa0a311d40d) + +1018. [func] sar + Added support for several options for use by PXE. + From RFC4578 (for DHCPv4) these are: 93 - client-system, + 94 - client-ndi, 97 - uuid-guid. + From RFC5970 (for DHCPv6) these are: 59 - bootfile-url, + 60 - bootfile-param, 61 - client-arch-type, 62 - nii. + (trac #3576, git fdcc73afe7e26bd427817fd771567b1c44713b06) + +1017. [func] tmark + Lease dump SQL logic, used by kea-admin, is now supplied via stored + procedures rather than external text files. Files of the form + lease_dump_.sh will no longer be installed under + /share/kea/scripts. + (Trac #3916, git 09cdd86a5e284250d7657a93a36df2e2705947d2) + +1016. [bug] fdupont + Fixed problems when --enable-static-link is specified as a + "configure" option. With this switch present, all Kea + executables (servers, tools, unit tests, etc) are linked + to the static (vs. shared) version of Kea libraries. + However, note that they can still be linked to dynamic + system libraries. + (Trac #4004, git 760a343efbd241f5ed333cfff088124378f69115) + +1015. [func] tomek + Expired declined leases can now be reclaimed (returned to the + available pool) after probation period elapses. + (Trac #3984, #3976, git 32a8ec68e0e5ea93991915812158d7628d2b4709) + +1014. [func] marcin + Implemented lease4_expire and lease6_expire hooks in libdhcpsrv. + (Trac #3972, git 8a8547aec1caf2a8d1c7ca206f68534f3c03f1d9) + +1013. [func] marcin + New mechanism for scheduling lease file cleanup is used in the + DHCPv4 and DHCPv6 servers. + (Trac #3971, git 431d515fc3d64aa82369c8eaf48d03339f12dc69) + +1012. [bug] stephen + Replace #include of message_dictionary.h in message_initializer.h + with a declaration of the MessageDictionary class, avoing the need + to include message_dictionary.h in the set of header files installed. + (Trac #4046, git 9f1801b4326f62632a7c9f0aa939d58f120c10e8) + +1011. [func] fdupont + Added definitions and tests for the options from secure DHCPv6. + This protocol is still experimental. The option and other protocol + codes are for testing, they will be updated when IANA assigns + official values. + (Trac #4015, git 95f8c0d0af45807c1f303b9bbbb08f82b3bfc343) + +1010. [bug] tmark + Fixed test failures occuring for some tests after + IfaceMgr::closeSockets was called. + (Trac #4067, git 9161867dc6a354659ae8b5115ee437ec76c1771e) + +1009. [bug] fdupont + Now libutil blocks all signals when creating a new thread + (so signals are delivered only to the main thread). + (Trac #4065, git a4a8e422e613e4378f0a0641e4c480b73d67ebeb) + +1008. [build] fdupont + Removed the included header-only ASIO code. Kea is now built + against the installed copy of Boost. The build by default + attempts to use the header-only error code (ASIO dependency), but + may also use the version in the boost system library. The + location of this library can be specified. + (Trac #4009, git 8c293bc0d1804a512964621f114e64fcba0abcb9) + +1007. [func] tomek + DECLINE message in DHCPv6 is now supported. The server is able + to receive it, check its correctness and move the lease to + DECLINED state. Currently there is no way to recover the lease + before 'decline-probation-period' time. + (Trac #3982, git 11e2c4366d8624601172c01e95cff6a8b95833b3) + +1006. [bug] marcin + Fixed issues with threads concurrency in the TimerMgr. + (Trac #4047, git 48297af6e0443808a482536b61436a42bc6a5b38) + 1005. [func] tomek DHCPDECLINE message in DHCPv4 is now supported. The server is able to receive it, check its correctness and move the lease to diff --cc src/bin/dhcp4/dhcp4_srv.cc index 1a46d7d221,066a17699a..fa3a832f49 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@@ -298,24 -309,17 +315,26 @@@ Dhcpv4Srv::selectSubnet(const Pkt4Ptr& selector.client_classes_ = query->classes_; selector.iface_name_ = query->getIface(); + // If the link-selection sub-option is present, extract its value. + // "The link-selection sub-option is used by any DHCP relay agent + // that desires to specify a subnet/link for a DHCP client request + // that it is relaying but needs the subnet/link specification to + // be different from the IP address the DHCP server should use + // when communicating with the relay agent." (RFC 3257) ++ // + // Try first Relay Agent Link Selection sub-option OptionPtr rai = query->getOption(DHO_DHCP_AGENT_OPTIONS); if (rai) { - OptionCustomPtr oc = boost::dynamic_pointer_cast(rai); - if (oc) { - OptionPtr ols = oc->getOption(RAI_OPTION_LINK_SELECTION); - if (ols) { - OptionBuffer lsb = ols->getData(); - if (lsb.size() == sizeof(uint32_t)) { + OptionCustomPtr rai_custom = + boost::dynamic_pointer_cast(rai); + if (rai_custom) { + OptionPtr link_select = + rai_custom->getOption(RAI_OPTION_LINK_SELECTION); + if (link_select) { + OptionBuffer link_select_buf = link_select->getData(); + if (link_select_buf.size() == sizeof(uint32_t)) { selector.option_select_ = - IOAddress::fromBytes(AF_INET, &lsb[0]); + IOAddress::fromBytes(AF_INET, &link_select_buf[0]); } } } diff --cc src/lib/dhcp/dhcp4.h index 2297d556b2,a010fa1d7e..e21d2ad125 --- a/src/lib/dhcp/dhcp4.h +++ b/src/lib/dhcp/dhcp4.h @@@ -165,62 -137,10 +165,62 @@@ enum DHCPOptionType DHO_AUTHENTICATE = 90, /* RFC3118, was 210 */ DHO_CLIENT_LAST_TRANSACTION_TIME = 91, DHO_ASSOCIATED_IP = 92, + DHO_SYSTEM = 93, /* RFC4578 */ + DHO_NDI = 94, /* RFC4578 */ +// DHO_LDAP = 95, + // 96 is removed/unassigned + DHO_UUID_GUID = 97, /* RFC4578 */ +// DHO_USER_AUTH = 98, +// DHO_GEOCONF_CIVIC = 99, +// DHO_PCODE = 100, +// DHO_TCODE = 101, + // 102-111 are removed/unassigned +// DHO_NETINFO_ADDR = 112, +// DHO_NETINFO_TAG = 113, +// DHO_URL = 114, + // 115 is removed/unassigned +// DHO_AUTO_CONFIG = 116, +// DHO_NAME_SERVICE_SEARCH = 117, - DHO_SUBNET_SELECTION = 118, /* RFC3011! */ + DHO_SUBNET_SELECTION = 118, /* RFC3011 */ DHO_DOMAIN_SEARCH = 119, /* RFC3397 */ +// DHO_SIP_SERVERS = 120, +// DHO_CLASSLESS_STATIC_ROUTE = 121, +// DHO_CCC = 122, +// DHO_GEOCONF = 123, DHO_VIVCO_SUBOPTIONS = 124, DHO_VIVSO_SUBOPTIONS = 125, + // 126-127 are removed/unassigned + // 128-135 have multiple definitions including PXE +// DHO_PANA_AGENT = 136, +// DHO_V4_LOST = 137, +// DHO_CAPWAP_AC_V4 = 138, +// DHO_IPV4_ADDR_MOS = 139, +// DHO_IPV4_FQDN_MOS = 140, +// DHO_SIP_UA_CONF_SERVICE_DOMAINS = 141, +// DHO_IPV4_ADDR_ANDSF = 142, + // 143 is removed/unassigned +// DHO_GEOLOC = 144, +// DHO_FORCERENEW_NONCE_CAPABLE = 145, +// DHO_RDNSS_SELECT = 146, + // 147-149 are removed/unassigned + // 150 have multiple definitions +// DHO_STATUS_CODE = 151, +// DHO_BASE_TIME = 152, +// DHO_START_TIME_OF_STATE = 153, +// DHO_QUERY_START_TIME = 154, +// DHO_QUERY_END_TIME = 155, +// DHO_DHCP_STATE = 156, +// DHO_DATA_SOURCE = 157, +// DHO_V4_PCP_SERVER = 158, +// DHO_V4_PORTPARAMS = 159, + // 160-211 are removed/unassigned +// DHO_6RD = 212, +// DHO_V4_ACCESS_DOMAIN = 213, + // 214-219 are removed/unassigned +// DHO_SUBNET_ALLOC = 220, +// DHO_VSS = 221, + // 222-223 are removed/unassigned + // 224-254 are reserved for private use DHO_END = 255 };