Skip to content

Commit

Permalink
[#3592] Addressed review comments
Browse files Browse the repository at this point in the history
Addressed first round of comments.

Changes to be committed:
modified:   ChangeLog
modified:   doc/sphinx/arm/classify.rst
modified:   doc/sphinx/arm/dhcp4-srv.rst
modified:   doc/sphinx/arm/dhcp6-srv.rst
modified:   src/bin/dhcp4/tests/classify_unittest.cc
modified:   src/lib/dhcp/classify.cc
modified:   src/lib/dhcp/classify.h
modified:   src/lib/dhcpsrv/parsers/base_network_parser.cc
modified:   src/lib/dhcpsrv/parsers/base_network_parser.h
modified:   src/lib/dhcpsrv/tests/shared_network_parser_unittest.cc
  • Loading branch information
tmarkwalder committed Nov 26, 2024
1 parent 0541000 commit 7eebd14
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 222 deletions.
6 changes: 3 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
added to HTTP responses.
(Gitlab #3609)

2304. [func] tmark
2305. [func] tmark
Both kea-dhcp4 and kea-dhcp6 servers will now
log a warning message when they detect classes that
configure lease life time parameters (e.g. 'valid-lifetime',
'preferred-lifetime') while also setting
'only-in-addditiional-list' to true.
'only-in-additiional-list' to true.
(Gitlab #2736)

2303. [bug] tmark
2304. [bug] tmark
Modified both kea-dhcp4 and kea-dhcp6 to avoid
generating DDNS update requests when leases are
being reused due to lease caching.
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/arm/classify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1005,11 +1005,11 @@ Configuring Subnets With Class Information
As of Kea 2.7.5, ``client-class`` (a single class name) has been replaced
with ``client-classes`` (a list of one or more class names) and is now
deprecated. It will still be accepted as input for a time to allow users
to migrate but will eventually be unsupported.
to migrate but will eventually be rejected.
In certain cases it is beneficial to restrict access to certain subnets
only to clients that belong to a given class, using the ``client-classes``
parameter when defining the subnet. This parameter may be used to sepcify
parameter when defining the subnet. This parameter may be used to specify
a list of one or more classes to which clients must belong in order to
use the subnet.

Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/arm/dhcp4-srv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3499,7 +3499,7 @@ to always be evaluated to ``true``.
As of Kea version 2.7.4, ``only-if-required`` and ``require-client-classes``
have been renamed to ``only-in-additional-list`` and ``evaluate-additional-classes``
respectivley. The original names will still be accepted as input to allow
users to migrate but will eventually be unsupported.
users to migrate but will eventually be rejected.

.. note::

Expand Down Expand Up @@ -6640,7 +6640,7 @@ for clients when client classification is in use, to ensure that the
appropriate subnet is selected for a given client type.

If a subnet is associated with one or more classes, only the clients belonging
to at least one of these classes may this subnet. If there are no classes
to at least one of these classes may use this subnet. If there are no classes
specified for a subnet, any client connected to a given shared network can use
this subnet. A common mistake is to assume that a subnet that includes a client
class is preferred over subnets without client classes.
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/arm/dhcp6-srv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3230,7 +3230,7 @@ to always be evaluated to ``true``.
As of Kea version 2.7.4, ``only-if-required`` and ``require-client-classes``
have been renamed to ``only-in-additional-list`` and ``evaluate-additional-classes``
respectivley. The original names will still be accepted as input to allow
users to migrate but will eventually be unsupported.
users to migrate but will eventually be rejected.

.. _dhcp6-ddns-config:

Expand Down
6 changes: 3 additions & 3 deletions src/bin/dhcp4/tests/classify_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2355,13 +2355,13 @@ TEST_F(ClassifyTest, networkScopeClientClasses) {
};

// Run scenarios.
for (const auto& scenario : scenarios) {
for (auto const& scenario : scenarios) {
ClientId id(scenario.client_id_);
SCOPED_TRACE(id.toText());
Pkt4Ptr query(new Pkt4(DHCPDISCOVER, 1234));
query->addOption(OptionPtr(new Option(Option::V4,
DHO_DHCP_CLIENT_IDENTIFIER,
id.getClientId())));
DHO_DHCP_CLIENT_IDENTIFIER,
id.getClientId())));
query->setIface("eth0");
query->setIndex(ETH0_INDEX);

Expand Down
3 changes: 1 addition & 2 deletions src/lib/dhcp/classify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ ClientClasses::intersects(const ClientClasses& cclasses) const {
return (true);
}
}
}
else {
} else {
for (const auto& cclass : cclasses) {
if (contains(cclass)) {
return (true);
Expand Down
Loading

0 comments on commit 7eebd14

Please sign in to comment.