]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[464-vivso-fix] Replaced vivso (v4 specific) by v6 vendor opts option
authorFrancis Dupont <fdupont@isc.org>
Mon, 18 Feb 2019 18:35:56 +0000 (19:35 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 19 Feb 2019 11:15:37 +0000 (12:15 +0100)
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/vendor_opts_unittest.cc

index e31230e65963cfe6b8468c220908733a2ab8454a..f2b6f723910fdbaa73473d92e8aadd85961ff690 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2019 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1257,8 +1257,8 @@ Dhcpv6Srv::appendRequestedVendorOptions(const Pkt6Ptr& question,
     }
 
     if (!vendor_rsp) {
-        // It's possible that vivso was inserted already by client class or
-        // a hook. If that is so, let's use it.
+        // It's possible that the vendor opts option was inserted already
+        // by client class or a hook. If that is so, let's use it.
         vendor_rsp.reset(new OptionVendor(Option::V6, vendor_id));
     }
 
index 6621fe0253cbaa515a9a7047c58a3e9321b52f30..10eb6f4bf56aff2094d8bb1b9969b46cc897f7c9 100644 (file)
@@ -351,21 +351,21 @@ TEST_F(VendorOptsTest, cableLabsShortVendorClass) {
     EXPECT_EQ(DHCP6_CLIENT_PORT, adv->getRemotePort());
 }
 
-// Checks that it's possible to have a vivso (125) option in the response
+// Checks that it's possible to have a vendor opts (17) option in the response
 // only. Once specific client (Genexis) sends only vendor-class info and
-// expects the server to include vivso in the response.
-TEST_F(VendorOptsTest, vivsoInResponseOnly) {
+// expects the server to include vendor opts in the response.
+TEST_F(VendorOptsTest, vendorOpsInResponseOnly) {
     IfaceMgrTestConfig test_config(true);
     IfaceMgr::instance().openSockets6();
     Dhcp6Client client;
 
-    // The config defines custom vendor (17) suboption 2 that conveys a TFTP URL.
-    // The client doesn't send vendor class (16) or vendor info (17) option, so
-    // normal vendor option processing is impossible. However, since there's a
-    // class defined that
-    // matches client's packets and that class inserts vivso in the response,
-    // Kea should be able to figure out the vendor-id and then also insert
-    // suboption 2 with the TFTP URL.
+    // The config defines custom vendor (17) suboption 2 that conveys
+    // a TFTP URL.  The client doesn't send vendor class (16) or
+    // vendor opts (17) option, so normal vendor option processing is
+    // impossible. However, since there's a class defined that matches
+    // client's packets and that class inserts a vendor opts in the
+    // response, Kea should be able to figure out the vendor-id and
+    // then also insert the suboption 2 with the TFTP URL.
     string config =
         "{"
         "    \"interfaces-config\": {"
@@ -419,13 +419,13 @@ TEST_F(VendorOptsTest, vivsoInResponseOnly) {
     OptionPtr rsp = client.getContext().response_->getOption(D6O_VENDOR_OPTS);
     ASSERT_TRUE(rsp);
 
-    // Check that it includes vivso with vendor-id = 25167
-    OptionVendorPtr rsp_vivso = boost::dynamic_pointer_cast<OptionVendor>(rsp);
-    ASSERT_TRUE(rsp_vivso);
-    EXPECT_EQ(25167, rsp_vivso->getVendorId());
+    // Check that it includes vendor opts with vendor-id = 25167
+    OptionVendorPtr rsp_vopts = boost::dynamic_pointer_cast<OptionVendor>(rsp);
+    ASSERT_TRUE(rsp_vopts);
+    EXPECT_EQ(25167, rsp_vopts->getVendorId());
 
     // Now check that it contains suboption 2 with appropriate content.
-    OptionPtr subopt2 = rsp_vivso->getOption(2);
+    OptionPtr subopt2 = rsp_vopts->getOption(2);
     ASSERT_TRUE(subopt2);
     vector<uint8_t> subopt2bin = subopt2->toBinary(false);
     string txt(subopt2bin.begin(), subopt2bin.end());