From: Marcin Siodelski Date: Thu, 6 Dec 2018 12:38:17 +0000 (+0100) Subject: [288,!158] Changed references for remaining RFCs obsoleted by RFC 8415. X-Git-Tag: 283-perfdhcp-fix-send-due_base~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974b033a8de7a8e671156c33efeb13d4ac847c96;p=thirdparty%2Fkea.git [288,!158] Changed references for remaining RFCs obsoleted by RFC 8415. --- diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml index 5c419a2c5d..230fbfe3e5 100644 --- a/doc/guide/dhcp6-srv.xml +++ b/doc/guide/dhcp6-srv.xml @@ -946,9 +946,9 @@ temporarily override a list of interface names and listen on all interfaces. Subnet and Prefix Delegation Pools Subnets may also be configured to delegate prefixes, as defined in - RFC 3633. A - subnet may have one or more prefix delegation pools. Each pool has a - prefixed address, which is specified as a prefix + RFC 8415, + section 6.3. A subnet may have one or more prefix delegation pools. + Each pool has a prefixed address, which is specified as a prefix (prefix) and a prefix length (prefix-len), as well as a delegated prefix length (delegated-len). The delegated length must not be diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 0e9465d657..440b26d620 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -2086,7 +2086,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer, if (leases.empty()) { // The server wasn't able allocate new lease and renew an existing - // lease. In that case, the server sends NoAddrsAvail per RFC7550. + // lease. In that case, the server sends NoAddrsAvail per RFC 8415. ia_rsp->addOption(createStatusCode(*query, *ia_rsp, STATUS_NoAddrsAvail, "Sorry, no addresses could be" @@ -2269,7 +2269,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query, if (leases.empty()) { // The server wasn't able allocate new lease and renew an existing - // lease. In that case, the server sends NoPrefixAvail per RFC7550. + // lease. In that case, the server sends NoPrefixAvail per RFC 8415. ia_rsp->addOption(createStatusCode(*query, *ia_rsp, STATUS_NoPrefixAvail, "Sorry, no prefixes could be" diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 8c6f2ee1ac..e8b8914234 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -413,11 +413,46 @@ protected: /// This function is called by the logic which processes Renew and Rebind /// messages to extend the lifetime of the existing prefix. /// - /// The behavior of this function is different in that when there is no - /// binding found in the lease database for the particular client the - /// NoBinding status code is returned when processing Renew, the exception - /// is thrown when there is no binding and the Rebind message is processed - /// (see RFC3633, section 12.2. for details). + /// The behavior of this function is different than @c extendIA_NA in that + /// when there is no subnet found for the rebinding case, the Rebind message + /// is discarded by the server. That behavior is based on the following + /// statement from the RFC 8415, section 18.3.5: + /// + /// "If the server chooses to not include any IAs containing IA Address or + /// IA Prefix options with lifetimes of 0 and the server does not include + /// any other IAs with leases and/or status codes, the server does not send + /// a Reply message. In this situation, the server discards the Rebind + /// message". + /// + /// @todo We should consider unification of the server behavior for address + /// assignment and prefix delegation with respect to Rebind message + /// processing. The RFC 8415, section 18.3.5 doesn't really differentiate + /// between IA_NA and IA_PD in how they should be processed by the server. + /// The intention of the spec is as follows: + /// + /// - If the server finds a lease but addresses and/or prefixes are not + /// appropriate anymore, it sends them with zero lifetimes. + /// - If the server doesn't find a lease the server checks if the addresses + /// and/or prefixes the client sends are appropriate and sends them back + /// with zero lifetimes if they aren't. + /// - The server may choose to not respond at all, if it cannot determine + /// whether the addresses and/or prefixes are appropriate and it doesn't + /// allocate any other addresses and/or prefixes. + /// - If the server cannot find the leases included in the Rebind, the + /// server may either allocate the leases or simply return NoBinding. + /// + /// The @c extendIA_PD function drops the Rebind message if it cannot find + /// the client entry (as a result of not finding a subnet for the client), + /// the @c extendIA_NA function sends NoBinding status code in that case. + /// Perhaps we should introduce an "Authoritative" configuration flag which, + /// if enabled, would cause the server to always respond, either indicating + /// that the address/prefix is inappropriate (with zero lifetimes) or that + /// there is no binding (NoBinding status code) for both addresses and + /// prefixes. When the "Authoritative" flag is disabled the server would + /// drop the Rebind for which there is neither subnet selected nor client + /// entry found (as it could be handled by another DHCP server). If nothing + /// else we could consider unifying the behavior of @c extendIA_NA and + /// @c extendIA_PD with respect to Rebind processing. /// /// @param query client's message /// @param ctx client context (contains subnet, duid and other parameters) diff --git a/src/bin/dhcp6/tests/dhcp6_client.cc b/src/bin/dhcp6/tests/dhcp6_client.cc index 32ed802f79..4c429e1f7d 100644 --- a/src/bin/dhcp6/tests/dhcp6_client.cc +++ b/src/bin/dhcp6/tests/dhcp6_client.cc @@ -525,7 +525,7 @@ Dhcp6Client::doRenew() { copyIAsFromLeases(query); // During the Renew the client may request additional bindings per - // RFC7550. + // RFC 8415. appendRequestedIAs(query); // Add Client FQDN if configured. @@ -549,7 +549,7 @@ Dhcp6Client::doRebind() { copyIAsFromLeases(query); // During the Rebind the client may request additional bindings per - // RFC7550. + // RFC 8415. appendRequestedIAs(query); // Add Client FQDN if configured. diff --git a/src/bin/dhcp6/tests/dhcp6_client.h b/src/bin/dhcp6/tests/dhcp6_client.h index 4a2b86df8b..13efc6a2d8 100644 --- a/src/bin/dhcp6/tests/dhcp6_client.h +++ b/src/bin/dhcp6/tests/dhcp6_client.h @@ -586,7 +586,7 @@ public: /// /// This method is typically called to specify IA_NA options to be /// sent to the server during 4-way handshakes and during lease - /// renewal to request allocation of new leases (as per RFC7550). + /// renewal to request allocation of new leases (as per RFC 8415). /// /// @param iaid IAID. /// @param address IPv6 address to be included in the IA_NA. It defaults @@ -607,7 +607,7 @@ public: /// /// This method is typically called to specify IA_PD options to be /// sent to the server during 4-way handshakes and during lease - /// renewal to request allocation of new leases (as per RFC7550). + /// renewal to request allocation of new leases (as per RFC 8415). /// /// @param iaid IAID. /// @param prefix_len Prefix length. diff --git a/src/bin/dhcp6/tests/rebind_unittest.cc b/src/bin/dhcp6/tests/rebind_unittest.cc index 915794382e..91d243c5c8 100644 --- a/src/bin/dhcp6/tests/rebind_unittest.cc +++ b/src/bin/dhcp6/tests/rebind_unittest.cc @@ -790,9 +790,11 @@ TEST_F(RebindTest, directClientPDChangingPrefix) { client.config_.leases_[0].addr_ = IOAddress("2001:db8:1:10::"); // Try to Rebind. The client will use correct IAID but will specify a // wrong prefix. The server will discover that the client has a binding - // but the prefix will not match. According to the RFC3633, section 12.2. - // the server has to return the lease with lifetimes set to 0, when there - // is a binding for the client but the prefix doesn't match. + // but the prefix will not match. According to the RFC 8415, section 18.3.5 + // the server may return delegated prefix with lifetime of 0 when it + // finds that the lease entry for the particular IAID but the prefix + // is not appropriate. This constitues explicit notification to the + // client to not use this prefix. ASSERT_NO_THROW(client.doRebind()); // Make sure that the server has discarded client's message. In such case, // the message sent back to the client should be NULL. diff --git a/src/lib/dhcp/dhcp6.h b/src/lib/dhcp/dhcp6.h index b2b84b872a..a6fa4dceda 100644 --- a/src/lib/dhcp/dhcp6.h +++ b/src/lib/dhcp/dhcp6.h @@ -42,14 +42,14 @@ enum DHCPv6OptionType { D6O_SIP_SERVERS_ADDR = 22, /* RFC3319 */ D6O_NAME_SERVERS = 23, /* RFC3646 */ D6O_DOMAIN_SEARCH = 24, /* RFC3646 */ - D6O_IA_PD = 25, /* RFC3633 */ - D6O_IAPREFIX = 26, /* RFC3633 */ + D6O_IA_PD = 25, /* RFC8415 */ + D6O_IAPREFIX = 26, /* RFC8415 */ D6O_NIS_SERVERS = 27, /* RFC3898 */ D6O_NISP_SERVERS = 28, /* RFC3898 */ D6O_NIS_DOMAIN_NAME = 29, /* RFC3898 */ D6O_NISP_DOMAIN_NAME = 30, /* RFC3898 */ D6O_SNTP_SERVERS = 31, /* RFC4075 */ - D6O_INFORMATION_REFRESH_TIME = 32, /* RFC4242 */ + D6O_INFORMATION_REFRESH_TIME = 32, /* RFC8415 */ D6O_BCMCS_SERVER_D = 33, /* RFC4280 */ D6O_BCMCS_SERVER_A = 34, /* RFC4280 */ // 35 is unassigned @@ -99,8 +99,8 @@ enum DHCPv6OptionType { D6O_CLIENT_LINKLAYER_ADDR = 79, /* RFC6939 */ D6O_LINK_ADDRESS = 80, /* RFC6977 */ // D6O_RADIUS = 81, /* RFC7037 */ - D6O_SOL_MAX_RT = 82, /* RFC7083 */ - D6O_INF_MAX_RT = 83, /* RFC7083 */ + D6O_SOL_MAX_RT = 82, /* RFC8415 */ + D6O_INF_MAX_RT = 83, /* RFC8415 */ // D6O_ADDRSEL = 84, /* RFC7078 */ // D6O_ADDRSEL_TABLE = 85, /* RFC7078 */ // D6O_V6_PCP_SERVER = 86, /* RFC7291 */ @@ -353,7 +353,7 @@ static const uint16_t DHCP6_SERVER_PORT = 547; */ #define DUID_TIME_EPOCH 946684800 -/* Information-Request Time option (RFC 4242) */ +/* Information-Request Time option (RFC 8415) */ #define IRT_DEFAULT 86400 #define IRT_MINIMUM 600