diff options
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | src/bin/dhcp6/dhcp6_messages.mes | 12 | ||||
-rw-r--r-- | src/bin/dhcp6/dhcp6_srv.cc | 24 | ||||
-rw-r--r-- | src/lib/dhcpsrv/dhcpdb_create.mysql | 14 |
4 files changed, 41 insertions, 33 deletions
@@ -1,7 +1,23 @@ -5XX. [bug] tmark, tomek - b10-dhcp6: Server aborts operation when receiving renew and there - are no IPv6 subnets configured. - (Trac 2719, git TBD) +576. [bug] tmark, tomek + b10-dhcp6: Fixed bug when the server aborts operation when + receiving renew and there are no IPv6 subnets configured. + (Trac 2719, git 3132b8b19495470bbfd0f2ba0fe7da443926034b) + +575. [bug] marcin + b10-dhcp6: Fixed the bug whereby the subnet for the incoming + packet was selected using only its source address. The subnet + is now selected using either source address or the name of the + server's interface on which the packet has been received. + (Trac #2704, git 1cbacf19a28bdae50bb9bd3767bca0147fde37ed) + +574. [func] tmark + b10-dhcp4, b10-dhcp6: Composite key indexes were added to the lease + tables to reduce lease search time. The lease4 table now has two + additional indexes: a) hwaddr/subnet_id and b) client_id/subnet_id. + The lease6 now has the one additional index: iaid/subnet_id/duid. + Adding these indexes significantly improves lease acquisition + performance. + (Trac #2699,#2703, git 54bbed5fcbe237c5a49b515ae4c55148723406ce) 573. [bug] stephen Fixed problem whereby the DHCP server crashed if it ran out of diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index 905c57f77c..72dff4c6cc 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -137,18 +137,6 @@ IPv6 DHCP server but it is not running. During startup the IPv6 DHCP server failed to detect any network interfaces and is therefore shutting down. -% DHCP6_NO_SUBNET_DEF_OPT failed to find subnet for address %1 when adding default options -This warning message indicates that when attempting to add default options -to a response, the server found that it was not configured to support -the subnet from which the DHCPv6 request was received. The packet has -been ignored. - -% DHCP6_NO_SUBNET_REQ_OPT failed to find subnet for address %1 when adding requested options -This warning message indicates that when attempting to add requested -options to a response, the server found that it was not configured -to support the subnet from which the DHCPv6 request was received. -The packet has been ignored. - % DHCP6_OPEN_SOCKET opening sockets on port %1 A debug message issued during startup, this indicates that the IPv6 DHCP server is about to open sockets on the specified port. diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index c2e743cd14..5f1580fbfb 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -408,29 +408,21 @@ Dhcpv6Srv::copyDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer) { } void -Dhcpv6Srv::appendDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer) { +Dhcpv6Srv::appendDefaultOptions(const Pkt6Ptr&, Pkt6Ptr& answer) { // add server-id answer->addOption(getServerID()); - - // Get the subnet object. It holds options to be sent to the client - // that belongs to the particular subnet. - Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(question->getRemoteAddr()); - // Warn if subnet is not supported and quit. - if (!subnet) { - LOG_WARN(dhcp6_logger, DHCP6_NO_SUBNET_DEF_OPT) - .arg(question->getRemoteAddr().toText()); - return; - } - } void Dhcpv6Srv::appendRequestedOptions(const Pkt6Ptr& question, Pkt6Ptr& answer) { - // Get the subnet for a particular address. - Subnet6Ptr subnet = CfgMgr::instance().getSubnet6(question->getRemoteAddr()); + // Get the configured subnet suitable for the incoming packet. + Subnet6Ptr subnet = selectSubnet(question); + // Leave if there is no subnet matching the incoming packet. + // There is no need to log the error message here because + // it will be logged in the assignLease() when it fails to + // pick the suitable subnet. We don't want to duplicate + // error messages in such case. if (!subnet) { - LOG_WARN(dhcp6_logger, DHCP6_NO_SUBNET_REQ_OPT) - .arg(question->getRemoteAddr().toText()); return; } diff --git a/src/lib/dhcpsrv/dhcpdb_create.mysql b/src/lib/dhcpsrv/dhcpdb_create.mysql index 695091dc87..f0da33786f 100644 --- a/src/lib/dhcpsrv/dhcpdb_create.mysql +++ b/src/lib/dhcpsrv/dhcpdb_create.mysql @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Internet Systems Consortium. +# Copyright (C) 2012-2013 Internet Systems Consortium. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -39,6 +39,14 @@ CREATE TABLE lease4 ( subnet_id INT UNSIGNED # Subnet identification ) ENGINE = INNODB; + +# Create search indexes for lease4 table +# index by hwaddr and subnet_id +CREATE INDEX lease4_by_hwaddr_subnet_id ON lease4 (hwaddr, subnet_id); + +# index by client_id and subnet_id +CREATE INDEX lease4_by_client_id_subnet_id ON lease4 (client_id, subnet_id); + # Holds the IPv6 leases. # N.B. The use of a VARCHAR for the address is temporary for development: # it will eventually be replaced by BINARY(16). @@ -55,6 +63,10 @@ CREATE TABLE lease6 ( prefix_len TINYINT UNSIGNED # For IA_PD only ) ENGINE = INNODB; +# Create search indexes for lease4 table +# index by iaid, subnet_id, and duid +CREATE INDEX lease6_by_iaid_subnet_id_duid ON lease6 (iaid, subnet_id, duid); + # ... and a definition of lease6 types. This table is a convenience for # users of the database - if they want to view the lease table and use the # type names, they can join this table with the lease6 table |