Browse Source

[master] Mitigate GCC 5.x optmizer issue in asiolink

    Merged in trac4243.
Thomas Markwalder 9 years ago
parent
commit
082f846f37

+ 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>

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

@@ -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 - 0
src/bin/dhcp4/tests/Makefile.am

@@ -26,6 +26,7 @@ AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
 
 CLEANFILES = $(builddir)/interfaces.txt $(builddir)/logger_lockfile
 CLEANFILES += $(builddir)/load_marker.txt $(builddir)/unload_marker.txt
+CLEANFILES += $(builddir)/test_leases.csv.*
 CLEANFILES += *.json *.log
 
 DISTCLEANFILES = dhcp4_process_tests.sh

+ 0 - 2
src/bin/dhcp6/dhcp6_srv.cc

@@ -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>

+ 1 - 0
src/bin/dhcp6/tests/Makefile.am

@@ -27,6 +27,7 @@ AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
 
 CLEANFILES  = $(builddir)/logger_lockfile
 CLEANFILES += $(builddir)/load_marker.txt $(builddir)/unload_marker.txt
+CLEANFILES += $(builddir)/test_leases.csv.*
 CLEANFILES += *.json *.log
 
 DISTCLEANFILES = dhcp6_process_tests.sh

+ 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;

+ 1 - 0
src/lib/asiolink/Makefile.am

@@ -18,6 +18,7 @@ lib_LTLIBRARIES = libkea-asiolink.la
 libkea_asiolink_la_LDFLAGS = -no-undefined -version-info 2:0:0
 
 libkea_asiolink_la_SOURCES  = asiolink.h
+libkea_asiolink_la_SOURCES += asio_wrapper.h
 libkea_asiolink_la_SOURCES += dummy_io_cb.h
 libkea_asiolink_la_SOURCES += interval_timer.cc interval_timer.h
 libkea_asiolink_la_SOURCES += io_address.cc io_address.h

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

@@ -0,0 +1,67 @@
+// 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
+
+// !!! IMPORTANT !!!!
+// This file must be included anywhere one would normally have included
+// boost/asio.hpp.  Until the issue described below is resolved in some
+// other fashion  asio.hpp should not be included other than through
+// this file.
+//
+// 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 #4243 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.
+//
+// We opened bugs with GNU and BOOST:
+//
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69789
+// https://svn.boost.org/trac/boost/ticket/11989
+//
+// @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 <= 50301)) \
+    && 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>

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

@@ -5,8 +5,7 @@
 // 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>
@@ -21,9 +20,9 @@
 #include <util/pid_file.h>
 #include <util/range_utilities.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;