Browse Source

[master] Changed NULL to 0 for FreeBSD build

Francis Dupont 8 years ago
parent
commit
35968a3bf4
2 changed files with 9 additions and 9 deletions
  1. 4 4
      src/lib/dhcp/iface_mgr.h
  2. 5 5
      src/lib/dhcp/tests/iface_mgr_unittest.cc

+ 4 - 4
src/lib/dhcp/iface_mgr.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015,2017 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // 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
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -877,7 +877,7 @@ public:
     /// @throw SocketOpenFailure if tried and failed to open socket.
     /// @throw SocketOpenFailure if tried and failed to open socket.
     /// @return true if any sockets were open
     /// @return true if any sockets were open
     bool openSockets6(const uint16_t port = DHCP6_SERVER_PORT,
     bool openSockets6(const uint16_t port = DHCP6_SERVER_PORT,
-                      IfaceMgrErrorMsgCallback error_handler = NULL);
+                      IfaceMgrErrorMsgCallback error_handler = 0);
 
 
     /// @brief Opens IPv4 sockets on detected interfaces.
     /// @brief Opens IPv4 sockets on detected interfaces.
     ///
     ///
@@ -946,7 +946,7 @@ public:
     /// @return true if any sockets were open
     /// @return true if any sockets were open
     bool openSockets4(const uint16_t port = DHCP4_SERVER_PORT,
     bool openSockets4(const uint16_t port = DHCP4_SERVER_PORT,
                       const bool use_bcast = true,
                       const bool use_bcast = true,
-                      IfaceMgrErrorMsgCallback error_handler = NULL);
+                      IfaceMgrErrorMsgCallback error_handler = 0);
 
 
     /// @brief Closes all open sockets.
     /// @brief Closes all open sockets.
     /// Is used in destructor, but also from Dhcpv4Srv and Dhcpv6Srv classes.
     /// Is used in destructor, but also from Dhcpv4Srv and Dhcpv6Srv classes.
@@ -1194,7 +1194,7 @@ private:
     bool openMulticastSocket(Iface& iface,
     bool openMulticastSocket(Iface& iface,
                              const isc::asiolink::IOAddress& addr,
                              const isc::asiolink::IOAddress& addr,
                              const uint16_t port,
                              const uint16_t port,
-                             IfaceMgrErrorMsgCallback error_handler = NULL);
+                             IfaceMgrErrorMsgCallback error_handler = 0);
 
 
     /// Holds instance of a class derived from PktFilter, used by the
     /// Holds instance of a class derived from PktFilter, used by the
     /// IfaceMgr to open sockets and send/receive packets through these
     /// IfaceMgr to open sockets and send/receive packets through these

+ 5 - 5
src/lib/dhcp/tests/iface_mgr_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // 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
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1471,7 +1471,7 @@ TEST_F(IfaceMgrTest, openSockets4) {
     ASSERT_NO_THROW(ifacemgr.setPacketFilter(custom_packet_filter));
     ASSERT_NO_THROW(ifacemgr.setPacketFilter(custom_packet_filter));
 
 
     // Simulate opening sockets using the dummy packet filter.
     // Simulate opening sockets using the dummy packet filter.
-    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, NULL));
+    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, 0));
 
 
     // Expect that the sockets are open on both eth0 and eth1.
     // Expect that the sockets are open on both eth0 and eth1.
     EXPECT_EQ(1, ifacemgr.getIface("eth0")->getSockets().size());
     EXPECT_EQ(1, ifacemgr.getIface("eth0")->getSockets().size());
@@ -1538,7 +1538,7 @@ TEST_F(IfaceMgrTest, openSockets4IfaceInactive) {
     // - is inactive
     // - is inactive
     ifacemgr.setIfaceFlags("eth1", false, true, true, true, false);
     ifacemgr.setIfaceFlags("eth1", false, true, true, true, false);
     ASSERT_TRUE(ifacemgr.getIface("eth1")->inactive4_);
     ASSERT_TRUE(ifacemgr.getIface("eth1")->inactive4_);
-    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, NULL));
+    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, 0));
 
 
     // The socket on eth0 should be open because interface is up, running and
     // The socket on eth0 should be open because interface is up, running and
     // active (not disabled through DHCP configuration, for example).
     // active (not disabled through DHCP configuration, for example).
@@ -1569,7 +1569,7 @@ TEST_F(IfaceMgrTest, openSockets4NoErrorHandler) {
 
 
     // The function throws an exception when it tries to open a socket
     // The function throws an exception when it tries to open a socket
     // and bind it to the address in use.
     // and bind it to the address in use.
-    EXPECT_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, NULL),
+    EXPECT_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, 0),
                  isc::dhcp::SocketConfigError);
                  isc::dhcp::SocketConfigError);
 
 
 }
 }
@@ -1629,7 +1629,7 @@ TEST_F(IfaceMgrTest, hasOpenSocketForAddress4) {
     ASSERT_NO_THROW(ifacemgr.setPacketFilter(custom_packet_filter));
     ASSERT_NO_THROW(ifacemgr.setPacketFilter(custom_packet_filter));
 
 
     // Simulate opening sockets using the dummy packet filter.
     // Simulate opening sockets using the dummy packet filter.
-    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, NULL));
+    ASSERT_NO_THROW(ifacemgr.openSockets4(DHCP4_SERVER_PORT, true, 0));
 
 
     // Expect that the sockets are open on both eth0 and eth1.
     // Expect that the sockets are open on both eth0 and eth1.
     ASSERT_EQ(1, ifacemgr.getIface("eth0")->getSockets().size());
     ASSERT_EQ(1, ifacemgr.getIface("eth0")->getSockets().size());