From: Francis Dupont Date: Thu, 16 Oct 2025 22:58:55 +0000 (+0200) Subject: [#3140] Post #4134 merge fixes X-Git-Tag: Kea-3.1.4~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff31859f647d1dc6d04d4b5152bdc7805dccd0ef;p=thirdparty%2Fkea.git [#3140] Post #4134 merge fixes --- diff --git a/changelog_unreleased/3140-add-statistics-counters-for-dropped-packets b/changelog_unreleased/3140-add-statistics-counters-for-dropped-packets index 3547e9fd1a..986b42512c 100644 --- a/changelog_unreleased/3140-add-statistics-counters-for-dropped-packets +++ b/changelog_unreleased/3140-add-statistics-counters-for-dropped-packets @@ -20,4 +20,8 @@ statistics which are increased when an incoming packet was dropped because an unexpected exception was thrown during processing. - (Gitlab #3140, #4157, #4146, #4127, #4126, #4133) + + Added "pkt4-limit-exceeded" and "pkt6-limit-exceeded" + statistics which are increased when an incoming packet + was dropped by the limits hook library. + (Gitlab #3140, #4157, #4146, #4127, #4126, #4133, #4134) diff --git a/changelog_unreleased/4134-add-drop-stats-limit-exceeded b/changelog_unreleased/4134-add-drop-stats-limit-exceeded deleted file mode 100644 index 445f8805b9..0000000000 --- a/changelog_unreleased/4134-add-drop-stats-limit-exceeded +++ /dev/null @@ -1,5 +0,0 @@ -[func] fdupont - Added "pkt4-limit-exceeded" and "pkt6-limit-exceeded" - statistics which are increased when an incoming packet - was dropped by the limits hook library. - (Gitlab #4134) diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 6e04a2b941..2b3a75d4e6 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -7835,9 +7835,6 @@ a second counter detailing the drop cause: - ``pkt4-parse-failed`` - packet parsing raised a fatal error -- ``pkt4-limit-exceeded`` - dropped by the limits (:ref:`hooks-limits`) - hook library - - ``pkt4-queue-full`` - parked packet in a queue which became full - ``pkt4-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them) @@ -7848,6 +7845,9 @@ a second counter detailing the drop cause: - ``pkt4-processing-failed`` - git an unexpected exception during processing +- ``pkt4-limit-exceeded`` - dropped by the limits (:ref:`hooks-limits`) + hook library + .. note:: The pool ID can be configured on each pool by explicitly setting the ``pool-id`` diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 98a8c1f67e..a148d33a65 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -6952,18 +6952,6 @@ The DHCPv6 server supports the following statistics: | | | This statistic is expected to grow | | | | rapidly. | +---------------------------------------------------+----------------+------------------------------------+ - | pkt6-receive-drop | integer | Number of incoming packets that | - | | | were dropped. The exact reason for | - | | | dropping packets is logged, but | - | | | the most common reasons may be | - | | | that an unacceptable or | - | | | not-supported packet type is | - | | | received, direct responses are | - | | | forbidden, the server ID sent by | - | | | the client does not match the | - | | | server's server ID, or the packet | - | | | is malformed. | - +---------------------------------------------------+----------------+------------------------------------+ | pkt6-service-disabled | integer | Number of incoming packets that | | | | were dropped when the DHCP service | | | | was disabled. | @@ -7005,6 +6993,18 @@ The DHCPv6 server supports the following statistics: | | | were dropped by the ``limits`` | | | | hook library. | +---------------------------------------------------+----------------+------------------------------------+ + | pkt6-receive-drop | integer | Number of incoming packets that | + | | | were dropped. The exact reason for | + | | | dropping packets is logged, but | + | | | the most common reasons may be | + | | | that an unacceptable or | + | | | not-supported packet type is | + | | | received, direct responses are | + | | | forbidden, the server ID sent by | + | | | the client does not match the | + | | | server's server ID, or the packet | + | | | is malformed. | + +---------------------------------------------------+----------------+------------------------------------+ | pkt6-solicit-received | integer | Number of SOLICIT packets | | | | received. This statistic is | | | | expected to grow; its increase | @@ -7730,9 +7730,6 @@ a second counter detailing the drop cause: - ``pkt6-parse-failed`` - packet parsing raised a fatal error -- ``pkt6-limit-exceeded`` - dropped by the limits (:ref:`hooks-limits`) - hook library - - ``pkt6-queue-full`` - parked packet in a queue which became full - ``pkt6-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them) @@ -7743,6 +7740,9 @@ a second counter detailing the drop cause: - ``pkt6-processing-failed`` - git an unexpected exception during processing +- ``pkt6-limit-exceeded`` - dropped by the limits (:ref:`hooks-limits`) + hook library + .. note:: The pool ID can be configured on each pool by explicitly setting the ``pool-id`` diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 4034b017b5..c232a68b5a 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -826,10 +826,10 @@ Dhcpv4Srv::selectSubnet(const Pkt4Ptr& query, bool& drop, bool allow_answer_park DHCP4_HOOK_SUBNET4_SELECT_PARKING_LOT_FULL) .arg(limit) .arg(query->getLabel()); - isc::stats::StatsMgr::instance().addValue("pkt4-queue-full", - static_cast(1)); - isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop", - static_cast(1)); + StatsMgr::instance().addValue("pkt4-queue-full", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); return (ConstSubnet4Ptr()); } @@ -997,10 +997,10 @@ Dhcpv4Srv::selectSubnet4o6(const Pkt4Ptr& query, bool& drop, DHCP4_HOOK_SUBNET4_SELECT_4O6_PARKING_LOT_FULL) .arg(limit) .arg(query->getLabel()); - isc::stats::StatsMgr::instance().addValue("pkt4-queue-full", - static_cast(1)); - isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop", - static_cast(1)); + StatsMgr::instance().addValue("pkt4-queue-full", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); return (ConstSubnet4Ptr()); } diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 33d92fb427..4ba05feca5 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -2190,10 +2190,10 @@ Dhcpv6Srv::selectSubnet(const Pkt6Ptr& question, bool& drop) { DHCP4_HOOK_SUBNET6_SELECT_PARKING_LOT_FULL) .arg(limit) .arg(question->getLabel()); - isc::stats::StatsMgr::instance().addValue("pkt6-queue-full", - static_cast(1)); - isc::stats::StatsMgr::instance().addValue("pkt6-receive-drop", - static_cast(1)); + StatsMgr::instance().addValue("pkt6-queue-full", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); return (ConstSubnet6Ptr()); }