testing/kea: upgrade to 1.4.0-r0

This commit is contained in:
Steve HOLWEG 2018-06-16 08:27:24 +02:00 committed by Andy Postnikov
parent d3ddb8d3de
commit 8cb9423ec1
3 changed files with 114 additions and 263 deletions

View File

@ -2,7 +2,7 @@
# Contributor: Baptiste Jonglez <baptiste--aur@jonglez.org>
pkgname=kea
pkgver=1.3.0
pkgver=1.4.0
pkgrel=0
pkgdesc="High-performance, extensible DHCP server engine from ISC, supporting both DHCPv4 and DHCPv6"
arch="all"
@ -12,9 +12,8 @@ depends=""
makedepends="botan-dev log4cplus-dev boost-dev postgresql-dev mariadb-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-admin:admin:noarch $pkgname-ctrl-agent:ctrlagent $pkgname-dhcp-ddns:dhcpddns $pkgname-dhcp4 $pkgname-dhcp6 $pkgname-keactrl:keactrl:noarch $pkgname-utils"
source="https://ftp.isc.org/isc/kea/${pkgver}/kea-${pkgver}.tar.gz
source="https://ftp.isc.org/isc/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz
fix-scripts-include-path.patch
boost-1.66.patch
kea-dhcp4.initd
kea-dhcp6.initd
kea-dhcp-ddns.initd
@ -150,9 +149,8 @@ utils() {
mv "${pkgdir}/usr/bin/kea-msg-compiler" "${subpkgdir}/usr/bin/kea-msg-compiler"
}
sha512sums="4708485efe537d9af00b50da9a3f33b740edaf37d9bbfe96f5625e30715349c48ef8a32f5abb8320f00821aea642a5b7ecdbc9f0d323a71b7a07f46f1bed978b kea-1.3.0.tar.gz
392e722dc559fdbc3799079f7394df2b1cea9e0259fe4d3d011174241bf10b885e03855c1b50dc3397437ca1217d324881b40948da33a858eb77514b853e3db0 fix-scripts-include-path.patch
07c8146bf65a38b15885bb6331b5e71dd2c337ac0c800564d953861209f5bc99c5af30bba4cbe2b18e4c2464a84e68776dc06eef6843598a926eef17dc526c64 boost-1.66.patch
sha512sums="ce4e2bcdc6f06472c4dccfc9cc26b06ff10ce1ce947b2bdc8753bbb15ff77831f7317625bdd81d24c945cf0d4c33cf9eef0ae0be21149532b0b9b9bc8892dd14 kea-1.4.0.tar.gz
293d523b59de8531ae0ecc1be863d9c47b940eb32017f769b212150250c86672bc0473b096eaa07ad6b682259b754a2f387a6ff2abec14a2fb8968f34585b0d5 fix-scripts-include-path.patch
9165141380f723c641411d1394cdeeeac8cf72321012ba0aafa36b64ec171eba996ed6bd1f5460523f7c4b32cb37b368331984bcd19ca82d9c63211fdbb0a36e kea-dhcp4.initd
6e7608d2133758bfc80828ef6a072127f25ac9d47cf16c1ca91eca1e5ee8c96a5a7d0e515725a8d9556205e6e70113177b6f7e5c4306385de6266aa5c09ea2d7 kea-dhcp6.initd
31705accecc50a50c7a01ba700acdc68fb10f776bb583e1c1ae78fb33f8ba9cc66f7e12686f057d9d534a26ca09cbe7879399ee31463b46a78d9f203524357af kea-dhcp-ddns.initd

View File

@ -1,256 +0,0 @@
From eace8a517077c39a37bfbcaf269d72ce190eff23 Mon Sep 17 00:00:00 2001
From: Francis Dupont <fdupont@isc.org>
Date: Thu, 29 Mar 2018 15:41:28 +0200
Subject: [PATCH] [5374] Updated asiolink
---
src/lib/asiolink/io_acceptor.h | 4 ++
src/lib/asiolink/io_address.h | 21 ++++++++---
src/lib/asiolink/io_asio_socket.h | 3 +-
src/lib/asiolink/io_service.h | 5 +++
src/lib/asiolink/tcp_socket.h | 54 ++++++++++++++++++++++++++-
src/lib/asiolink/tests/io_service_unittest.cc | 2 +
src/lib/asiolink/tests/run_unittests.cc | 2 +
src/lib/asiolink/udp_socket.h | 4 ++
src/lib/asiolink/unix_domain_socket.cc | 4 ++
9 files changed, 90 insertions(+), 9 deletions(-)
diff --git a/src/lib/asiolink/io_acceptor.h b/src/lib/asiolink/io_acceptor.h
index c493d3427e..913a3280b2 100644
--- a/src/lib/asiolink/io_acceptor.h
+++ b/src/lib/asiolink/io_acceptor.h
@@ -47,7 +47,11 @@ class IOAcceptor : public IOSocket {
/// @brief Returns file descriptor of the underlying socket.
virtual int getNative() const {
+#if BOOST_VERSION < 106600
return (acceptor_->native());
+#else
+ return (acceptor_->native_handle());
+#endif
}
/// @brief Opens acceptor socket given the endpoint.
diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h
index 5747cb9291..42f09d7a9f 100644
--- a/src/lib/asiolink/io_address.h
+++ b/src/lib/asiolink/io_address.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2018 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
@@ -23,11 +23,20 @@
namespace isc {
namespace asiolink {
- /// Defines length of IPv6 address.
- const static size_t V6ADDRESS_LEN = 16;
+ /// Defines length of IPv6 address (in binary format).
+ static constexpr size_t V6ADDRESS_LEN = 16;
- /// Defines length of IPv4 address.
- const static size_t V4ADDRESS_LEN = 4;
+ /// Defines length of IPv4 address (in binary format).
+ static constexpr size_t V4ADDRESS_LEN = 4;
+
+ /// @brief Maximum size of an IPv4 address represented as a text string. 12
+ /// digits plus 3 full stops (dots).
+ static constexpr size_t V4ADDRESS_TEXT_MAX_LEN = 15u;
+
+ /// @brief Maximum size of an IPv6 address represented as a text string. 32
+ /// hexadecimal characters written in 8 groups of four, plus 7 colon
+ /// separators.
+ static constexpr size_t V6ADDRESS_TEXT_MAX_LEN = 39u;
/// \brief The \c IOAddress class represents an IP addresses (version
/// agnostic)
@@ -136,7 +145,7 @@ class IOAddress {
/// \brief Creates an address from over wire data.
///
- /// \param family AF_NET for IPv4 or AF_NET6 for IPv6.
+ /// \param family AF_INET for IPv4 or AF_INET6 for IPv6.
/// \param data pointer to first char of data
///
/// \return Created IOAddress object
diff --git a/src/lib/asiolink/io_asio_socket.h b/src/lib/asiolink/io_asio_socket.h
index cdb4074db2..49f5041db4 100644
--- a/src/lib/asiolink/io_asio_socket.h
+++ b/src/lib/asiolink/io_asio_socket.h
@@ -16,13 +16,14 @@
#include <string>
#include <exceptions/exceptions.h>
-#include <coroutine.h>
#include <util/buffer.h>
#include <asiolink/io_error.h>
#include <asiolink/io_socket.h>
+#include <boost/asio/coroutine.hpp>
+
namespace isc {
namespace asiolink {
diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h
index e9e402d114..e0832b2c04 100644
--- a/src/lib/asiolink/io_service.h
+++ b/src/lib/asiolink/io_service.h
@@ -11,7 +11,12 @@
namespace boost {
namespace asio {
+#if BOOST_VERSION < 106600
class io_service;
+#else
+ class io_context;
+ typedef io_context io_service;
+#endif
}
}
diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h
index adf74d1f0f..f1297e0630 100644
--- a/src/lib/asiolink/tcp_socket.h
+++ b/src/lib/asiolink/tcp_socket.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 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
@@ -75,7 +75,11 @@ class TCPSocket : public IOAsioSocket<C> {
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
+#if BOOST_VERSION < 106600
return (socket_.native());
+#else
+ return (socket_.native_handle());
+#endif
}
/// \brief Return protocol of socket
@@ -90,6 +94,48 @@ class TCPSocket : public IOAsioSocket<C> {
return (false);
}
+ /// \brief Checks if the connection is usable.
+ ///
+ /// The connection is usable if the socket is open and the peer has not
+ /// closed its connection.
+ ///
+ /// \return true if the connection is usable.
+ bool isUsable() const {
+ // If the socket is open it doesn't mean that it is still usable. The connection
+ // could have been closed on the other end. We have to check if we can still
+ // use this socket.
+ if (socket_.is_open()) {
+ // Remember the current non blocking setting.
+ const bool non_blocking_orig = socket_.non_blocking();
+ // Set the socket to non blocking mode. We're going to test if the socket
+ // returns would_block status on the attempt to read from it.
+ socket_.non_blocking(true);
+
+ boost::system::error_code ec;
+ char data[2];
+
+ // Use receive with message peek flag to avoid removing the data awaiting
+ // to be read.
+ socket_.receive(boost::asio::buffer(data, sizeof(data)),
+ boost::asio::socket_base::message_peek,
+ ec);
+
+ // Revert the original non_blocking flag on the socket.
+ socket_.non_blocking(non_blocking_orig);
+
+ // If the connection is alive we'd typically get would_block status code.
+ // If there are any data that haven't been read we may also get success
+ // status. We're guessing that try_again may also be returned by some
+ // implementations in some situations. Any other error code indicates a
+ // problem with the connection so we assume that the connection has been
+ // closed.
+ return (!ec || (ec.value() == boost::asio::error::try_again) ||
+ (ec.value() == boost::asio::error::would_block));
+ }
+
+ return (false);
+ }
+
/// \brief Open Socket
///
/// Opens the TCP socket. This is an asynchronous operation, completion of
@@ -227,7 +273,11 @@ TCPSocket<C>::~TCPSocket()
template <typename C> void
TCPSocket<C>::open(const IOEndpoint* endpoint, C& callback) {
-
+ // If socket is open on this end but has been closed by the peer,
+ // we need to reconnect.
+ if (socket_.is_open() && !isUsable()) {
+ close();
+ }
// Ignore opens on already-open socket. Don't throw a failure because
// of uncertainties as to what precedes whan when using asynchronous I/O.
// At also allows us a treat a passed-in socket as a self-managed socket.
diff --git a/src/lib/asiolink/tests/io_service_unittest.cc b/src/lib/asiolink/tests/io_service_unittest.cc
index 70887c3d24..b1c33956be 100644
--- a/src/lib/asiolink/tests/io_service_unittest.cc
+++ b/src/lib/asiolink/tests/io_service_unittest.cc
@@ -4,6 +4,8 @@
// 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/io_service.h>
#include <gtest/gtest.h>
diff --git a/src/lib/asiolink/tests/run_unittests.cc b/src/lib/asiolink/tests/run_unittests.cc
index 7044863677..395dcd1d6e 100644
--- a/src/lib/asiolink/tests/run_unittests.cc
+++ b/src/lib/asiolink/tests/run_unittests.cc
@@ -4,6 +4,8 @@
// 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 <util/unittests/run_all.h>
#include <log/logger_manager.h>
diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h
index 07ba44743e..5b040cfe1b 100644
--- a/src/lib/asiolink/udp_socket.h
+++ b/src/lib/asiolink/udp_socket.h
@@ -61,7 +61,11 @@ class UDPSocket : public IOAsioSocket<C> {
/// \brief Return file descriptor of underlying socket
virtual int getNative() const {
+#if BOOST_VERSION < 106600
return (socket_.native());
+#else
+ return (socket_.native_handle());
+#endif
}
/// \brief Return protocol of socket
diff --git a/src/lib/asiolink/unix_domain_socket.cc b/src/lib/asiolink/unix_domain_socket.cc
index f17ec2e8f7..d1ad9ec30c 100644
--- a/src/lib/asiolink/unix_domain_socket.cc
+++ b/src/lib/asiolink/unix_domain_socket.cc
@@ -287,7 +287,11 @@ UnixDomainSocket::UnixDomainSocket(IOService& io_service)
int
UnixDomainSocket::getNative() const {
+#if BOOST_VERSION < 106600
return (impl_->socket_.native());
+#else
+ return (impl_->socket_.native_handle());
+#endif
}
int

View File

@ -94,6 +94,42 @@ diff -ru /src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in /src/share/d
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`mysql_version "$@"`
diff -ru /src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in /src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in
--- /src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in 2017-08-01 13:03:52.823615380 +0200
+++ /src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in 2017-08-01 13:11:43.007623495 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`mysql_version "$@"`
diff -ru /src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in /src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in
--- /src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in 2017-08-01 13:03:52.823615380 +0200
+++ /src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in 2017-08-01 13:11:43.007623495 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
@ -159,4 +195,77 @@ diff -ru /src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in /src/share/d
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`pgsql_version "$@"`
diff -ru /src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in /src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in
--- /src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in 2017-08-01 13:03:52.826948671 +0200
+++ /src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in 2017-08-01 13:11:52.627500763 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`pgsql_version "$@"`
diff -ru /src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in /src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in
--- /src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in 2017-08-01 13:03:52.826948671 +0200
+++ /src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in 2017-08-01 13:11:52.627500763 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`pgsql_version "$@"`
diff -ru /src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in /src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in
--- /src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in 2017-08-01 13:03:52.826948671 +0200
+++ /src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in 2017-08-01 13:11:52.627500763 +0200
@@ -1,12 +1,7 @@
#!/bin/sh
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
VERSION=`pgsql_version "$@"`
diff -ru /src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in /src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in
--- /src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in 2017-08-01 13:03:52.826948671 +0200
+++ /src/share/database/scripts/cql/upgrade_1.0_to_2.0.sh.in 2017-08-01 13:11:52.627500763 +0200
@@ -1,13 +1,9 @@
#!/bin/sh
prefix=@prefix@
-# Include utilities. Use installed version if available and
-# use build version if it isn't.
-if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
- . @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
-else
- . @abs_top_builddir@/src/bin/admin/admin-utils.sh
-fi
+
+# Include utilities.
+. /usr/share/kea/scripts/admin-utils.sh
version=$(cql_version "$@")