]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#467] Commented vendor id sets
authorFrancis Dupont <fdupont@isc.org>
Mon, 6 Mar 2023 13:56:03 +0000 (14:56 +0100)
committerFrancis Dupont <fdupont@isc.org>
Mon, 6 Mar 2023 14:06:04 +0000 (15:06 +0100)
src/bin/dhcp4/dhcp4_srv.cc

index 1f45b7a6d2240e5108205c24544550be1911304f..c158cf47896423d9c6821e2f907a5fcaf2f5c907 100644 (file)
@@ -1883,6 +1883,8 @@ Dhcpv4Srv::appendRequestedOptions(Dhcpv4Exchange& ex) {
     // Special cases for vendor class and options which are identified
     // by the code/type and the vendor/enterprise id vs. the code/type only.
     if (requested_opts.count(DHO_VIVCO_SUBOPTIONS) > 0) {
+        // Keep vendor ids which are already in the response to insert
+        // VIVCO options at most once per vendor.
         set<uint32_t> vendor_ids;
         // Get what already exists in the response.
         for (auto opt : resp->getOptions(DHO_VIVCO_SUBOPTIONS)) {
@@ -1892,7 +1894,7 @@ Dhcpv4Srv::appendRequestedOptions(Dhcpv4Exchange& ex) {
                 static_cast<void>(vendor_ids.insert(vendor_opts->getVendorId()));
             }
         }
-        // Iterate on the configured option list
+        // Iterate on the configured option list.
         for (auto const& copts : co_list) {
             for (OptionDescriptor desc : copts->getList(DHCP4_OPTION_SPACE,
                                                         DHO_VIVCO_SUBOPTIONS)) {
@@ -1917,6 +1919,8 @@ Dhcpv4Srv::appendRequestedOptions(Dhcpv4Exchange& ex) {
     }
 
     if (requested_opts.count(DHO_VIVSO_SUBOPTIONS) > 0) {
+        // Keep vendor ids which are already in the response to insert
+        // VIVSO options at most once per vendor.
         set<uint32_t> vendor_ids;
         // Get what already exists in the response.
         for (auto opt : resp->getOptions(DHO_VIVSO_SUBOPTIONS)) {