Browse Source

Compilation fix for NetBSD and gcc on Solaris 10

Tomek Mrugalski 13 years ago
parent
commit
5bb1a0ebbe
2 changed files with 4 additions and 3 deletions
  1. 2 2
      src/lib/dhcp/libdhcp.cc
  2. 2 1
      src/lib/dhcp/tests/option6_ia_unittest.cc

+ 2 - 2
src/lib/dhcp/libdhcp.cc

@@ -101,8 +101,8 @@ LibDHCP::packOptions6(boost::shared_array<uint8_t> data,
         }
     }
     catch (const Exception& e) {
-        cout << "Packet build failed." << endl;
-        return (-1);
+        cout << "Packet build failed (Option build failed)." << endl;
+        throw;
     }
     return (offset);
 }

+ 2 - 1
src/lib/dhcp/tests/option6_ia_unittest.cc

@@ -248,7 +248,8 @@ TEST_F(Option6IATest, suboptions_unpack) {
 
     EXPECT_EQ(0xcafe, subopt->getType());
     EXPECT_EQ(4, subopt->len());
-    EXPECT_EQ(NULL, subopt->getData());
+    // there should be no data at all
+    EXPECT_EQ(static_cast<void*>(NULL), subopt->getData());
 
     subopt = ia->getOption(1); // get option 1
     ASSERT_FALSE(subopt); // should be NULL