BIND 10 trac3282, updated. 1422c7b03ba6d90ce0b8e0c6a02e6cbbe68c7a9e [3282] Fixed setDomainName methods

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jan 17 21:31:14 UTC 2014


The branch, trac3282 has been updated
       via  1422c7b03ba6d90ce0b8e0c6a02e6cbbe68c7a9e (commit)
      from  a66dc23ea5d6c6ecd34d9598d7e111d1c0ce696d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1422c7b03ba6d90ce0b8e0c6a02e6cbbe68c7a9e
Author: Thomas Markwalder <tmark at isc.org>
Date:   Fri Jan 17 16:27:56 2014 -0500

    [3282] Fixed setDomainName methods
    
    Modified the setDomainName() method in both Option4ClientFqdn
    and Option6ClientFqdn to always the domain name type based
    on the type parameter passed in.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcp/option4_client_fqdn.cc                |    5 +++--
 src/lib/dhcp/option6_client_fqdn.cc                |    5 +++--
 src/lib/dhcp/tests/option4_client_fqdn_unittest.cc |    3 ++-
 src/lib/dhcp/tests/option6_client_fqdn_unittest.cc |    3 ++-
 4 files changed, 10 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/option4_client_fqdn.cc b/src/lib/dhcp/option4_client_fqdn.cc
index 7f93a50..d546ab2 100644
--- a/src/lib/dhcp/option4_client_fqdn.cc
+++ b/src/lib/dhcp/option4_client_fqdn.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -217,7 +217,6 @@ setDomainName(const std::string& domain_name,
     } else {
         try {
             domain_name_.reset(new isc::dns::Name(name));
-            domain_name_type_ = name_type;
 
         } catch (const Exception& ex) {
             isc_throw(InvalidOption4FqdnDomainName,
@@ -227,6 +226,8 @@ setDomainName(const std::string& domain_name,
 
         }
     }
+
+    domain_name_type_ = name_type;
 }
 
 void
diff --git a/src/lib/dhcp/option6_client_fqdn.cc b/src/lib/dhcp/option6_client_fqdn.cc
index 761acae..d9eb0b2 100644
--- a/src/lib/dhcp/option6_client_fqdn.cc
+++ b/src/lib/dhcp/option6_client_fqdn.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -188,7 +188,6 @@ setDomainName(const std::string& domain_name,
     } else {
         try {
             domain_name_.reset(new isc::dns::Name(name, true));
-            domain_name_type_ = name_type;
 
         } catch (const Exception& ex) {
             isc_throw(InvalidOption6FqdnDomainName, "invalid domain-name value '"
@@ -197,6 +196,8 @@ setDomainName(const std::string& domain_name,
 
         }
     }
+
+    domain_name_type_ = name_type;
 }
 
 void
diff --git a/src/lib/dhcp/tests/option4_client_fqdn_unittest.cc b/src/lib/dhcp/tests/option4_client_fqdn_unittest.cc
index cdd7c64..ae658d2 100644
--- a/src/lib/dhcp/tests/option4_client_fqdn_unittest.cc
+++ b/src/lib/dhcp/tests/option4_client_fqdn_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -615,6 +615,7 @@ TEST(Option4ClientFqdnTest, setDomainName) {
     // Empty domain name (partial). This should be successful.
     ASSERT_NO_THROW(option->setDomainName("", Option4ClientFqdn::PARTIAL));
     EXPECT_TRUE(option->getDomainName().empty());
+    EXPECT_EQ(Option4ClientFqdn::PARTIAL, option->getDomainNameType());
 
     // Fully qualified domain-names must not be empty.
     EXPECT_THROW(option->setDomainName("", Option4ClientFqdn::FULL),
diff --git a/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc b/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
index d644a2e..dac38e1 100644
--- a/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
+++ b/src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -537,6 +537,7 @@ TEST(Option6ClientFqdnTest, setDomainName) {
     // Empty domain name (partial). This should be successful.
     ASSERT_NO_THROW(option->setDomainName("", Option6ClientFqdn::PARTIAL));
     EXPECT_TRUE(option->getDomainName().empty());
+    EXPECT_EQ(Option6ClientFqdn::PARTIAL, option->getDomainNameType());
 
     // Fully qualified domain-names must not be empty.
     EXPECT_THROW(option->setDomainName("", Option6ClientFqdn::FULL),



More information about the bind10-changes mailing list