From: Francis Dupont Date: Mon, 18 Feb 2019 18:35:56 +0000 (+0100) Subject: [464-vivso-fix] Replaced vivso (v4 specific) by v6 vendor opts option X-Git-Tag: 397-cb-implement-mysqlconfigbackenddhcpv6_base~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c79da9358862657a631a9a8fc2ce79ae26b762e;p=thirdparty%2Fkea.git [464-vivso-fix] Replaced vivso (v4 specific) by v6 vendor opts option --- diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index e31230e659..f2b6f72391 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -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)); } diff --git a/src/bin/dhcp6/tests/vendor_opts_unittest.cc b/src/bin/dhcp6/tests/vendor_opts_unittest.cc index 6621fe0253..10eb6f4bf5 100644 --- a/src/bin/dhcp6/tests/vendor_opts_unittest.cc +++ b/src/bin/dhcp6/tests/vendor_opts_unittest.cc @@ -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(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(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 subopt2bin = subopt2->toBinary(false); string txt(subopt2bin.begin(), subopt2bin.end());