]> git.ipfire.org Git - thirdparty/kea.git/commit
[#900,!561] kea-dhcp4/6 now quietly drop empty or all-null string options
authorThomas Markwalder <tmark@isc.org>
Mon, 21 Oct 2019 14:38:53 +0000 (10:38 -0400)
committerThomas Markwalder <tmark@isc.org>
Wed, 23 Oct 2019 12:57:58 +0000 (08:57 -0400)
commita917e4ae7e36e1273d3be5c370a1d3d705ded22b
tree80abc622206f4afff2c15921fe5ee89f2f81d3ad
parentfb19df73794ae0fd035007911e2f4332497439c8
[#900,!561] kea-dhcp4/6 now quietly drop empty or all-null string options

src/lib/dhcp/option.h
    class SkipThisOptionError - new exception type

src/lib/dhcp/libdhcp++.cc
    LibDHCP::unpackOptions4()
    LibDHCP::unpackOptions6() - explicitly catches and handles
    SkipThisOptionError expceptions

src/lib/dhcp/option_definition.cc
    OptionDefinition::optionFactory() - now rethrows SkipThisOptionError

src/lib/dhcp/option_int.h
    OptionInt::unpack() - altered ambiguous exception text

src/lib/dhcp/option_int_array.h
    OptionIntArray::unpack() - altered ambiguous exception text

src/lib/dhcp/option_string.cc
    OptionString::unpack() - now throws SkipThisOptionError if option, once
    trimmed, is empty

src/lib/dhcp/tests/option_string_unittest.cc
    Updated tests

src/lib/dhcp/tests/pkt4_unittest.cc
    TEST_F(Pkt4Test, testSkipThisOptionError) - new test

src/lib/dhcp/tests/pkt6_unittest.cc
    TEST_F(Pkt6Test, testSkipThisOptionError) - new test

src/lib/dhcpsrv/tests/cfg_option_unittest.cc
    Updated expected exception text

src/lib/testutils/gtest_utils.h
    Added two macros to emit exception info on throws.
    #define EXPECT_NO_THROW_LOG(statement)
    #define ASSERT_NO_THROW_LOG(statement)
12 files changed:
ChangeLog
src/lib/dhcp/libdhcp++.cc
src/lib/dhcp/option.h
src/lib/dhcp/option_definition.cc
src/lib/dhcp/option_int.h
src/lib/dhcp/option_int_array.h
src/lib/dhcp/option_string.cc
src/lib/dhcp/tests/option_string_unittest.cc
src/lib/dhcp/tests/pkt4_unittest.cc
src/lib/dhcp/tests/pkt6_unittest.cc
src/lib/dhcpsrv/tests/cfg_option_unittest.cc
src/lib/testutils/gtest_utils.h