Browse Source

[4243] Disable optimization of boost:asio for gcc 5.2.0 through 5.3.0

Optimization of boost:asio code is now disabled when building with
BOOST_ERROR_CODE_HEADER_ONLY under GCC versions 5.2.0 through 5.3.0.

src/lib/asiolink/asio_wrapper.h
    New file which wraps boost/asio/asio.hpp around compilation
    logic to suppress optimization under GNU 5.2.0 thru 5.3.0.

The remaining changes either removed the inclusion of <asio/asio.hpp> or
replaced it with the inclusion of <<asiolink/asio_wrapper.h>.  Inclusion
file order was also altered to better comply with our coding guidelines.
Thomas Markwalder 9 years ago
parent
commit
ac5d93b8f3

+ 2 - 4
src/bin/d2/d2_process.cc

@@ -1,18 +1,16 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
+#include <asiolink/asio_wrapper.h>
 #include <cc/command_interpreter.h>
 #include <d2/d2_log.h>
 #include <d2/d2_cfg_mgr.h>
 #include <d2/d2_process.h>
 
-#include <boost/asio.hpp>
-
 namespace isc {
 namespace d2 {
 

+ 3 - 4
src/bin/d2/tests/nc_test_utils.cc

@@ -1,17 +1,16 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/udp_endpoint.h>
 #include <d2/d2_cfg_mgr.h>
 #include <dns/opcode.h>
 #include <dns/messagerenderer.h>
 #include <nc_test_utils.h>
-#include <boost/asio.hpp>
-#include <asiolink/udp_endpoint.h>
 #include <util/encode/base64.h>
 
 #include <gtest/gtest.h>

+ 2 - 6
src/bin/d2/tests/nc_trans_unittests.cc

@@ -1,11 +1,11 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_service.h>
 #include <asiolink/interval_timer.h>
 #include <d2/nc_trans.h>
@@ -16,10 +16,6 @@
 #include <util/buffer.h>
 #include <nc_test_utils.h>
 
-#include <boost/asio/ip/udp.hpp>
-#include <boost/asio/socket_base.hpp>
-#include <boost/asio.hpp>
-
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>

+ 1 - 2
src/bin/dhcp4/dhcp4_srv.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
@@ -50,7 +50,6 @@
 #endif
 #include <dhcpsrv/memfile_lease_mgr.h>
 
-#include <boost/asio.hpp>
 #include <boost/bind.hpp>
 #include <boost/foreach.hpp>
 #include <boost/shared_ptr.hpp>

+ 1 - 3
src/bin/dhcp6/dhcp6_srv.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
@@ -58,8 +58,6 @@
 #endif
 #include <dhcpsrv/memfile_lease_mgr.h>
 
-#include <boost/asio.hpp>
-
 #include <boost/bind.hpp>
 #include <boost/foreach.hpp>
 #include <boost/tokenizer.hpp>

+ 12 - 19
src/lib/asiodns/io_fetch.cc

@@ -1,23 +1,11 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-#include <unistd.h>             // for some IPC/network system calls
-#include <netinet/in.h>
-#include <stdint.h>
-#include <sys/socket.h>
-
-#include <boost/bind.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
-#include <boost/asio.hpp>
-#include <boost/asio/deadline_timer.hpp>
-
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
@@ -26,17 +14,22 @@
 #include <asiolink/tcp_socket.h>
 #include <asiolink/udp_endpoint.h>
 #include <asiolink/udp_socket.h>
-
+#include <asiodns/io_fetch.h>
+#include <asiodns/logger.h>
 #include <dns/messagerenderer.h>
 #include <dns/opcode.h>
 #include <dns/rcode.h>
-
-#include <asiodns/io_fetch.h>
-
 #include <util/buffer.h>
 #include <util/random/qid_gen.h>
 
-#include <asiodns/logger.h>
+#include <boost/bind.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+
+#include <unistd.h>             // for some IPC/network system calls
+#include <netinet/in.h>
+#include <stdint.h>
+#include <sys/socket.h>
 
 using namespace boost::asio;
 using namespace isc::asiolink;

+ 18 - 22
src/lib/asiodns/tests/io_fetch_unittest.cc

@@ -1,10 +1,27 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_address.h>
+#include <asiolink/io_endpoint.h>
+#include <asiolink/io_service.h>
+#include <asiodns/io_fetch.h>
+#include <dns/question.h>
+#include <dns/message.h>
+#include <dns/messagerenderer.h>
+#include <dns/opcode.h>
+#include <dns/name.h>
+#include <dns/rcode.h>
+#include <util/buffer.h>
+#include <util/io_utilities.h>
+
+#include <gtest/gtest.h>
+#include <boost/bind.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
 
 #include <algorithm>
 #include <cstdlib>
@@ -14,27 +31,6 @@
 #include <iterator>
 #include <vector>
 
-#include <gtest/gtest.h>
-#include <boost/bind.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
-#include <boost/asio.hpp>
-
-#include <util/buffer.h>
-#include <util/io_utilities.h>
-
-#include <dns/question.h>
-#include <dns/message.h>
-#include <dns/messagerenderer.h>
-#include <dns/opcode.h>
-#include <dns/name.h>
-#include <dns/rcode.h>
-
-#include <asiolink/io_address.h>
-#include <asiolink/io_endpoint.h>
-#include <asiolink/io_service.h>
-#include <asiodns/io_fetch.h>
-
 using namespace boost::asio;
 using namespace isc::dns;
 using namespace isc::util;

+ 56 - 0
src/lib/asiolink/asio_wrapper.h

@@ -0,0 +1,56 @@
+// Copyright (C) 2016 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
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#ifndef ASIO_WRAPPER_H
+#define ASIO_WRAPPER_H 1
+
+// The optimizer as of gcc 5.2.0, may not reliably ensure a single value
+// returned by boost::system::system_category() within a translation unit
+// when building the header only version of the boost error handling.
+// See Trac #4309 for more details. For now we turn off optimization for
+// header only builds the under the suspect GCC versions.
+//
+// The issue arises from in-lining the above function, which returns a
+// reference to a local static variable, system_category_const,  This leads
+// to situations where a construct such as the following:
+//
+// {{{
+//    if (ec == boost::asio::error::would_block
+//       || ec == boost::asio::error::try_again)
+//      return false;
+// }}}
+//
+// which involve implicit conversion of enumerates to error_code instances
+// to not evaluate correctly.  During the implicit conversion the error_code
+// instances may be assigned differeing values error_code:m_cat. This
+// causes two instances of error_code which should have been equal to
+// to not be equal.
+//
+// The problem disappers if either error handling code is not built header
+// only as this results in a single definiton of system_category() supplied
+// by libboost_system; or the error handling code is not optimized.
+//
+// We're doing the test here, rather than in configure to guard against the
+// user supplying the header only flag via environment variables.
+//
+// @todo Currently, 5.3.0 is the latest released versio of GCC. Version 6.0 is
+// in development and will need to be tested.
+
+#define GNU_CC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+
+#if (defined(__GNUC__) && \
+    ((GNU_CC_VERSION >= 50200) && (GNU_CC_VERSION <= 50300)) \
+    && defined(BOOST_ERROR_CODE_HEADER_ONLY))
+#pragma GCC push_options
+#pragma GCC optimize ("O0")
+#include <boost/asio.hpp>
+#pragma GCC pop_options
+#else
+#include <boost/asio.hpp>
+#endif
+
+#endif // ASIO_WRAPPER_H

+ 4 - 5
src/lib/asiolink/interval_timer.cc

@@ -1,10 +1,13 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/interval_timer.h>
+#include <asiolink/io_service.h>
 
 #include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
@@ -12,10 +15,6 @@
 
 #include <exceptions/exceptions.h>
 
-#include <boost/asio.hpp>
-#include <asiolink/interval_timer.h>
-#include <asiolink/io_service.h>
-
 namespace isc {
 namespace asiolink {
 

+ 7 - 8
src/lib/asiolink/io_address.cc

@@ -1,23 +1,22 @@
-// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_address.h>
+#include <asiolink/io_error.h>
+#include <exceptions/exceptions.h>
+
+#include <boost/static_assert.hpp>
 
 #include <unistd.h>             // for some IPC/network system calls
 #include <stdint.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-#include <boost/asio.hpp>
-
-#include <exceptions/exceptions.h>
-#include <asiolink/io_address.h>
-#include <asiolink/io_error.h>
-#include <boost/static_assert.hpp>
-
 using namespace boost::asio;
 using boost::asio::ip::udp;
 using boost::asio::ip::tcp;

+ 2 - 4
src/lib/asiolink/io_endpoint.cc

@@ -1,13 +1,11 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-#include <boost/asio.hpp>
-
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_error.h>
 #include <asiolink/io_endpoint.h>

+ 3 - 4
src/lib/asiolink/io_service.cc

@@ -1,18 +1,17 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_service.h>
 
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
 #include <sys/socket.h>
 
-#include <boost/asio.hpp>
-#include <asiolink/io_service.h>
-
 namespace isc {
 namespace asiolink {
 

+ 4 - 4
src/lib/asiolink/io_socket.cc

@@ -1,12 +1,12 @@
-// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#include "io_socket.h"
-
-#include <boost/asio.hpp>
+#include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_socket.h>
 
 namespace isc {
 namespace asiolink {

+ 4 - 5
src/lib/asiolink/tests/dummy_io_callback_unittest.cc

@@ -1,16 +1,15 @@
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <gtest/gtest.h>
-
-#include <boost/asio.hpp>
-
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/dummy_io_cb.h>
 
+#include <gtest/gtest.h>
+
 using namespace isc::asiolink;
 using namespace boost::asio;
 

+ 3 - 4
src/lib/asiolink/tests/interval_timer_unittest.cc

@@ -1,16 +1,15 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <gtest/gtest.h>
-
-#include <boost/asio.hpp>
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/asiolink.h>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
+#include <gtest/gtest.h>
 
 namespace {
 // TODO: Consider this margin

+ 4 - 5
src/lib/asiolink/tests/io_socket_unittest.cc

@@ -1,17 +1,16 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <gtest/gtest.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_socket.h>
 
+#include <gtest/gtest.h>
 #include <netinet/in.h>
 
-#include <boost/asio.hpp>
-#include <asiolink/io_socket.h>
-
 using namespace isc::asiolink;
 
 TEST(IOSocketTest, dummySockets) {

+ 5 - 6
src/lib/asiolink/tests/tcp_endpoint_unittest.cc

@@ -1,18 +1,17 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-#include <string>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_address.h>
+#include <asiolink/tcp_endpoint.h>
 
 #include <gtest/gtest.h>
 
-#include <boost/asio.hpp>
-#include <asiolink/io_address.h>
-#include <asiolink/tcp_endpoint.h>
+#include <string>
 
 using namespace isc::asiolink;
 using namespace std;

+ 11 - 17
src/lib/asiolink/tests/tcp_socket_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
@@ -11,33 +11,27 @@
 /// work.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_service.h>
+#include <asiolink/tcp_endpoint.h>
+#include <asiolink/tcp_socket.h>
+#include <util/buffer.h>
+#include <util/io_utilities.h>
 
-#include <string>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <gtest/gtest.h>
 
+#include <string>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-
 #include <algorithm>
 #include <cstdlib>
 #include <cstddef>
 #include <vector>
 
-#include <gtest/gtest.h>
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <util/buffer.h>
-#include <util/io_utilities.h>
-
-#include <boost/asio.hpp>
-
-#include <asiolink/io_service.h>
-#include <asiolink/tcp_endpoint.h>
-#include <asiolink/tcp_socket.h>
-
 using namespace boost::asio;
 using namespace boost::asio::ip;
 using namespace isc::util;

+ 5 - 6
src/lib/asiolink/tests/udp_endpoint_unittest.cc

@@ -1,18 +1,17 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-#include <string>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_address.h>
+#include <asiolink/udp_endpoint.h>
 
 #include <gtest/gtest.h>
 
-#include <boost/asio.hpp>
-#include <asiolink/io_address.h>
-#include <asiolink/udp_endpoint.h>
+#include <string>
 
 using namespace isc::asiolink;
 using namespace std;

+ 11 - 16
src/lib/asiolink/tests/udp_socket_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
@@ -11,32 +11,27 @@
 /// work.
 
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_service.h>
+#include <asiolink/udp_endpoint.h>
+#include <asiolink/udp_socket.h>
+#include <util/buffer.h>
+#include <util/io_utilities.h>
 
-#include <string>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <gtest/gtest.h>
 
+#include <string>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-
 #include <algorithm>
 #include <cstdlib>
 #include <cstddef>
 #include <vector>
 
-#include <gtest/gtest.h>
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <util/buffer.h>
-#include <util/io_utilities.h>
-
-#include <boost/asio.hpp>
-
-#include <asiolink/io_service.h>
-#include <asiolink/udp_endpoint.h>
-#include <asiolink/udp_socket.h>
 
 using namespace boost::asio;
 using namespace isc::util;

+ 2 - 5
src/lib/dhcp/iface_mgr.cc

@@ -1,14 +1,11 @@
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-// This must be included before udp_endpoint.h
-#include <boost/asio.hpp>
-
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_error.h>
 #include <asiolink/udp_endpoint.h>
 #include <dhcp/dhcp4.h>

+ 3 - 2
src/lib/dhcp_ddns/ncr_io.cc

@@ -1,13 +1,14 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#include <config.h>
+#include <asiolink/asio_wrapper.h>
 #include <dhcp_ddns/dhcp_ddns_log.h>
 #include <dhcp_ddns/ncr_io.h>
 
-#include <boost/asio.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 
 namespace isc {

+ 1 - 3
src/lib/dhcp_ddns/ncr_udp.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
@@ -9,8 +9,6 @@
 #include <dhcp_ddns/dhcp_ddns_log.h>
 #include <dhcp_ddns/ncr_udp.h>
 
-#include <boost/asio/ip/udp.hpp>
-#include <boost/system/error_code.hpp>
 #include <boost/bind.hpp>
 
 namespace isc {

+ 3 - 2
src/lib/dhcp_ddns/ncr_udp.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 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
@@ -98,7 +98,8 @@
 /// NameChangeListener::invokeRecvHandler in the case of the UDP listener, or
 /// NameChangeSender::invokeSendHandler in the case of UDP sender.
 ///
-#include <boost/asio.hpp>
+
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <asiolink/udp_endpoint.h>

+ 3 - 4
src/lib/dhcpsrv/tests/d2_udp_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 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
@@ -8,16 +8,15 @@
 /// Note these tests are not intended to verify the actual send and receive
 /// across UDP sockets.  This level of testing is done in libdhcp-ddns.
 
-#include <boost/asio.hpp>
-#include <asiolink/io_service.h>
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
+#include <asiolink/io_service.h>
 #include <dhcp/iface_mgr.h>
 #include <dhcpsrv/d2_client_mgr.h>
 #include <exceptions/exceptions.h>
 
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
-
 #include <gtest/gtest.h>
 
 #include <sys/select.h>

+ 3 - 4
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc

@@ -1,12 +1,11 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-
-#include <boost/asio.hpp>
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_address.h>
 #include <dhcp/duid.h>
 #include <dhcp/iface_mgr.h>
@@ -20,9 +19,9 @@
 #include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
 #include <util/pid_file.h>
 #include <util/stopwatch.h>
-#include <gtest/gtest.h>
 
 #include <boost/bind.hpp>
+#include <gtest/gtest.h>
 
 #include <cstdlib>
 #include <iostream>

+ 4 - 2
src/lib/dhcpsrv/tests/timer_mgr_unittest.cc

@@ -1,17 +1,19 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#include <boost/asio.hpp>
 #include <config.h>
+#include <asiolink/asio_wrapper.h>
 #include <dhcp/iface_mgr.h>
 #include <dhcpsrv/timer_mgr.h>
 #include <exceptions/exceptions.h>
 #include <util/stopwatch.h>
+
 #include <boost/bind.hpp>
 #include <gtest/gtest.h>
+
 #include <sstream>
 #include <unistd.h>
 

+ 5 - 2
src/lib/dhcpsrv/timer_mgr.cc

@@ -1,10 +1,11 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016 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
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#include <boost/asio.hpp>
+#include <config.h>
+#include <asiolink/asio_wrapper.h>
 #include <asiolink/io_service.h>
 #include <dhcp/iface_mgr.h>
 #include <dhcpsrv/dhcpsrv_log.h>
@@ -13,7 +14,9 @@
 #include <util/threads/sync.h>
 #include <util/threads/thread.h>
 #include <util/watch_socket.h>
+
 #include <boost/bind.hpp>
+
 #include <utility>
 
 using namespace isc;