Merge pull request #6899 from diizzyy/patch-12
authorchamptar <champetier.etienne@gmail.com>
Sun, 23 Sep 2018 17:07:55 +0000 (10:07 -0700)
committerGitHub <noreply@github.com>
Sun, 23 Sep 2018 17:07:55 +0000 (10:07 -0700)
libs/sqlite: Update to 3.24.0

239 files changed:
README.md
admin/muninlite/Makefile
admin/muninlite/patches/240-fix-irqstats.patch [new file with mode: 0644]
admin/syslog-ng/Makefile
admin/syslog-ng/files/syslog-ng.conf
admin/syslog-ng/patches/001-fix-compat-getent-musl.patch [new file with mode: 0644]
admin/syslog-ng/patches/001-fix-secret-storage.patch [deleted file]
lang/jamvm/Makefile
lang/jamvm/patches/001-Use-fenv.h-instead-of-fpu_control.h.patch [new file with mode: 0644]
lang/php7/Makefile
lang/python/flup/Makefile
lang/python/jdcal/Makefile
lang/python/python-certifi/Makefile
lang/python/python-cryptography/Makefile
lang/python/python-dateutil/Makefile
lang/python/python-evdev/Makefile
lang/python/python-lxml/Makefile
lang/python/python-pcapy/Makefile
lang/python/python-pyasn1-modules/Makefile
lang/python/python3/Makefile
lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch [new file with mode: 0644]
lang/python/pytz/Makefile
libs/boost/Makefile
libs/classpath/Makefile
libs/classpath/patches/020-fix-statement-may-fall-through.patch [new file with mode: 0644]
libs/expat/Makefile
libs/glib2/Makefile
libs/hwloc/Makefile [new file with mode: 0644]
libs/icu/Makefile
libs/keyutils/Makefile [new file with mode: 0644]
libs/keyutils/patches/03-cifs.patch [new file with mode: 0644]
libs/keyutils/patches/04-cflags.patch [new file with mode: 0644]
libs/ldns/Makefile
libs/ldns/patches/100-CVE-2017-1000231.patch [new file with mode: 0644]
libs/ldns/patches/101-CVE-2017-1000232.patch [new file with mode: 0644]
libs/libcups/Makefile [new file with mode: 0644]
libs/libdmapsharing/Makefile
libs/libfastjson/Makefile
libs/libfmt/Makefile
libs/libftdi1/Makefile
libs/libftdi1/patches/101-use-findSWIG.patch [new file with mode: 0644]
libs/libpng/Makefile
libs/libseccomp/Makefile
libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch [deleted file]
libs/libtalloc/Makefile
libs/libtalloc/patches/100-Remove_libbsd_dependency_check.patch [new file with mode: 0644]
libs/libtirpc/Makefile
libs/libtirpc/patches/002-libtirpc-1.0.4-rc2.patch [deleted file]
libs/libupnp/Makefile
libs/libuvc/Makefile
libs/libv4l/Makefile
libs/libv4l/patches/020-add-missing-includes.patch
libs/libv4l/patches/030-dont-call-getsubopt.patch [deleted file]
libs/libwebsockets/Makefile
libs/p11-kit/Makefile
libs/tdb/Makefile
libs/tdb/patches/100-Remove_libbsd_dependency_check.patch [new file with mode: 0644]
libs/tiff/Makefile
libs/tiff/patches/027-CVE-2017-17095.patch [new file with mode: 0644]
mail/clamsmtp/Makefile
mail/clamsmtp/patches/010-fix-build.patch [new file with mode: 0644]
mail/mailman/Makefile
mail/mailman/patches/100-postfix.patch
mail/mailman/patches/200-nohostdnspython.patch
mail/mailman/patches/300-targetpython.patch
mail/mailman/patches/400-modules.patch
mail/mutt/Makefile
mail/postfix/Makefile
mail/postfix/files/postfix.init
multimedia/ffmpeg/Makefile
multimedia/gst1-libav/Makefile
multimedia/gst1-plugins-bad/Makefile
multimedia/gst1-plugins-base/Makefile
multimedia/gst1-plugins-good/Makefile
multimedia/gst1-plugins-ugly/Makefile
multimedia/gstreamer1/Makefile
multimedia/motion/Makefile
multimedia/motion/patches/010-Initialize-the-thread-at-start-of-main.patch [new file with mode: 0644]
multimedia/motion/patches/100-musl-compat.patch [deleted file]
net/acme/Makefile
net/acme/files/acme-cbi.lua
net/acme/files/acme.config
net/acme/files/run.sh
net/adblock/Makefile
net/adblock/files/README.md
net/adblock/files/adblock.conf
net/adblock/files/adblock.init
net/adblock/files/adblock.notify
net/adblock/files/adblock.sh
net/aria2/files/aria2.init
net/ariang/files/80_ariang-nginx-support
net/chrony/Makefile
net/chrony/files/chronyd.init
net/chrony/patches/002-undefined_MIN.patch [new file with mode: 0644]
net/clamav/Makefile
net/cshark/Makefile
net/ddns-scripts/Makefile
net/ddns-scripts/files/dynamic_dns_functions.sh
net/dmapd/Makefile
net/esniper/Makefile
net/fwknop/Makefile
net/geth/Makefile
net/git/Makefile
net/haproxy/Makefile
net/haproxy/patches/0000-BUG-MEDIUM-servers-check-the-queues-once-enabling-a-server.patch [new file with mode: 0644]
net/haproxy/patches/0001-BUG-MEDIUM-queue-prevent-a-backup-server-from-draining-the-proxys-connections.patch [new file with mode: 0644]
net/haproxy/patches/0002-MINOR-dns-fix-wrong-score-computation-in-dns_get_ip_from_response.patch [new file with mode: 0644]
net/haproxy/patches/0003-MINOR-dns-new-DNS-options-to-allow-prevent-IP-address-duplication.patch [new file with mode: 0644]
net/haproxy/patches/0004-BUG-MEDIUM-lua-possible-CLOSE-WAIT-state-with-n-headers.patch [new file with mode: 0644]
net/haproxy/patches/0005-MINOR-threads-Introduce-double-width-CAS-on-x86_64-and-arm.patch [new file with mode: 0644]
net/haproxy/patches/0006-BUG-MEDIUM-threads-fix-the-double-CAS-implementation-for-ARMv7.patch [new file with mode: 0644]
net/haproxy/patches/0007-MINOR-threads-add-more-consistency-between-certain-variables-in-no-thread-case.patch [new file with mode: 0644]
net/haproxy/patches/0008-BUG-MEDIUM-threads-fix-the-no-thread-case-after-the-change-to-the-sync-point.patch [new file with mode: 0644]
net/haproxy/patches/0009-MEDIUM-hathreads-implement-a-more-flexible-rendez-vous-point.patch [new file with mode: 0644]
net/haproxy/patches/0010-BUG-MEDIUM-cli-make-show-fd-thread-safe.patch [new file with mode: 0644]
net/haproxy/patches/0011-BUG-MINOR-ssl-empty-connections-reported-as-errors.patch [new file with mode: 0644]
net/haproxy/patches/0012-BUG-MEDIUM-ssl-fix-missing-error-loading-a-keytype-cert-from-a-bundle.patch [new file with mode: 0644]
net/haproxy/patches/0013-BUG-MEDIUM-ssl-loading-dh-param-from-certifile-causes-unpredictable-error.patch [new file with mode: 0644]
net/haproxy/patches/0014-BUG-MINOR-map-fix-map_regm-with-backref.patch [new file with mode: 0644]
net/haproxy/patches/0015-DOC-dns-explain-set-server-fqdn-requires-resolver.patch [new file with mode: 0644]
net/haproxy/patches/0016-DOC-ssl-Use-consistent-naming-for-TLS-protocols.patch [new file with mode: 0644]
net/haproxy/patches/0017-BUG-MEDIUM-lua-socket-timeouts-are-not-applied.patch [new file with mode: 0644]
net/haproxy/patches/0018-BUG-MEDIUM-cli-threads-protect-all-proxy-commands-against-concurrent-updates.patch [new file with mode: 0644]
net/haproxy/patches/0019-BUG-MEDIUM-cli-threads-protect-some-server-commands-against-concurrent-operations.patch [new file with mode: 0644]
net/haproxy/patches/0020-DOC-Fix-spelling-error-in-configuration-doc.patch [new file with mode: 0644]
net/haproxy/patches/0021-BUG-MEDIUM-unix-provide-a---drain-function.patch [new file with mode: 0644]
net/haproxy/patches/0022-BUG-MINOR-lua-Bad-HTTP-client-request-duration.patch [new file with mode: 0644]
net/haproxy/patches/0023-BUG-MEDIUM-mux_pt-dereference-the-connection-with-care-in-mux_pt_wake.patch [new file with mode: 0644]
net/https-dns-proxy/Makefile
net/https-dns-proxy/files/https_dns_proxy.config
net/https-dns-proxy/files/https_dns_proxy.init
net/i2pd/Makefile
net/jool/Makefile
net/keepalived/Makefile
net/keepalived/patches/0001-Include-stdbool.h-in-process.c.patch [new file with mode: 0644]
net/krb5/Makefile
net/mosquitto/Makefile
net/mtr/Makefile
net/mtr/patches/010-remove-libcap-support.patch [deleted file]
net/mtr/patches/020-Sami-Kerola-prevent-MTR-reporting-unknown-revision.patch [deleted file]
net/mwan3/Makefile
net/mwan3/files/etc/config/mwan3
net/mwan3/files/etc/hotplug.d/iface/16-mwan3 [new file with mode: 0644]
net/mwan3/files/lib/mwan3/mwan3.sh
net/mwan3/files/usr/sbin/mwan3
net/mwan3/files/usr/sbin/mwan3rtmon [new file with mode: 0755]
net/nfs-kernel-server/Makefile
net/nginx/Makefile
net/nut/Makefile
net/nut/files/30-libhid-ups.head [new file with mode: 0755]
net/nut/files/30-libhid-ups.tail [new file with mode: 0644]
net/nut/files/nut-cgi.init
net/nut/files/nut-monitor.init
net/nut/files/nut-server.init
net/nut/files/nut_cgi
net/nut/files/nut_monitor
net/nut/files/nut_server
net/nut/files/nutshutdown [new file with mode: 0755]
net/openvswitch/Makefile
net/openvswitch/README.md
net/openvswitch/files/openvswitch.init
net/openvswitch/files/ovs-ctl-wrapper
net/openvswitch/patches/0100-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch
net/openvswitch/patches/0102-python-separate-host-target-python-for-cross-compile.patch
net/openvswitch/patches/0103-ovs-ctl-fix-setting-hostname.patch
net/openvswitch/patches/0104-ovs-lib-fix-install_dir.patch
net/openvswitch/patches/0105-build-disable-building-tests.patch
net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch [new file with mode: 0644]
net/openvswitch/patches/0107-datapath-use-KARCH-when-building-linux-datapath-modu.patch [new file with mode: 0644]
net/radsecproxy/Makefile
net/radsecproxy/patches/100-fix-debug-tid.patch [deleted file]
net/rsyslog/Makefile
net/samba4/Config.in
net/samba4/Makefile
net/samba4/files/samba.init
net/samba4/files/smb.conf.template
net/samba4/patches/103-samba-4.8.5-unbundle-libbsd.patch [new file with mode: 0644]
net/samba4/waf-cross-answers/aarch64.txt
net/samba4/waf-cross-answers/arc.txt
net/samba4/waf-cross-answers/arm.txt
net/samba4/waf-cross-answers/armeb.txt
net/samba4/waf-cross-answers/i386.txt
net/samba4/waf-cross-answers/mips.txt
net/samba4/waf-cross-answers/mips64.txt
net/samba4/waf-cross-answers/mips64el.txt
net/samba4/waf-cross-answers/mipsel.txt
net/samba4/waf-cross-answers/powerpc.txt
net/samba4/waf-cross-answers/x86_64.txt
net/socat/Makefile
net/spoofer/Makefile [new file with mode: 0644]
net/strongswan/patches/101-musl-fixes.patch
net/strongswan/patches/300-include-ipsec-hotplug.patch
net/strongswan/patches/305-minimal_dh_plugin.patch
net/stubby/Makefile
net/stunnel/Makefile
net/tor/Makefile
net/travelmate/Makefile
net/travelmate/files/README.md
net/travelmate/files/travelmate.init
net/travelmate/files/travelmate.sh
net/unbound/Makefile
net/unbound/files/README.md
net/unbound/files/unbound.sh
net/unbound/patches/200-openssl-log-err.patch [deleted file]
net/wsdd2/Makefile
net/wsdd2/patches/001-add_uuid_boot_id.patch
net/zerotier/Makefile
net/zerotier/files/etc/config/zerotier [new file with mode: 0644]
net/zerotier/files/etc/init.d/zerotier [new file with mode: 0755]
net/zerotier/files/zerotier.config [deleted file]
net/zerotier/files/zerotier.init [deleted file]
sound/espeak/Makefile
sound/espeak/patches/101-Fix_GCC_narrowing_conversion_errors.patch [new file with mode: 0644]
sound/espeak/patches/101-portaudio.patch [deleted file]
sound/portaudio/Makefile
utils/at/Makefile
utils/bonnie++/Makefile
utils/bonnie++/patches/001-cross_compile_fix.patch
utils/crelay/Makefile
utils/fio/Makefile
utils/fish/Makefile [new file with mode: 0644]
utils/fish/patches/001-no-hostname-and-whoami.patch [new file with mode: 0644]
utils/hplip/Makefile [new file with mode: 0644]
utils/hplip/files/20-hplip [new file with mode: 0644]
utils/hplip/files/hplib.conf [new file with mode: 0644]
utils/hplip/patches/010-libusb_fix.patch [new file with mode: 0644]
utils/hplip/patches/020-remove_cups_dep_on_scan.patch [new file with mode: 0644]
utils/hplip/patches/030-replace_unsafe_memcpy_with_memmove.patch [new file with mode: 0644]
utils/hplip/patches/040-fix_bool.patch [new file with mode: 0644]
utils/less/Makefile
utils/mc/Config.in
utils/mc/Makefile
utils/nano/Makefile
utils/nano/patches/001-upstream-fix-for-3.1-tiny-compilation.patch [new file with mode: 0644]
utils/ttyd/Makefile
utils/yunbridge/Makefile
utils/zoneinfo/Makefile
utils/zsh/Makefile

index d908a86abb121e7ad338c357b9f0283a028d48ae..373f74e24eefe6b110b05ee98f5e41c204b7f09d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,11 +4,11 @@
 
 This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.
 
-Installation of pre-built packages is handled directly by the **opkg** utility within your running OpenWrt system or by using the [OpenWrt SDK](http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk) on a build system.
+Installation of pre-built packages is handled directly by the **opkg** utility within your running OpenWrt system or by using the [OpenWrt SDK](https://openwrt.org/docs/guide-developer/obtain.firmware.sdk) on a build system.
 
 ## Usage
 
-This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: [OpenWrt Buildroot â€“ Installation](http://wiki.openwrt.org/doc/howto/buildroot.exigence) on the OpenWrt support site.
+This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: [OpenWrt Buildroot â€“ Installation](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) on the OpenWrt support site.
 
 This feed is enabled by default. To install all its package definitions, run:
 ```
index 022da01881a7cf80df807cf0731b33725eaf6185..2d98cf34e8f96cfd04a9e67f12dcd06f93c2382b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=muninlite
 PKG_VERSION:=1.0.4
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
diff --git a/admin/muninlite/patches/240-fix-irqstats.patch b/admin/muninlite/patches/240-fix-irqstats.patch
new file mode 100644 (file)
index 0000000..4e2fb23
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/plugins/irqstats 2007-11-30 11:39:08.000000000 +0100
++++ b/plugins/irqstats 2018-08-29 08:20:50.809468406 +0200
+@@ -1,6 +1,6 @@
+ config_irqstats() {
+   echo "graph_title Individual interrupts
+-graph_args --base 1000 -l 0;
++graph_args --base 1000 -l 0
+ graph_vlabel interrupts / \${graph_period}
+ graph_category system"
+   CPUS=$(grep 'CPU[0-9]' /proc/interrupts | wc -w)
index 219ce03a82a134da8fc44adda31ae5932b53644d..948983416ad678dcd0b161841730fab8381a987b 100644 (file)
@@ -1,14 +1,14 @@
 include  $(TOPDIR)/rules.mk
 
 PKG_NAME:=syslog-ng
-PKG_VERSION:=3.16.1
+PKG_VERSION:=3.17.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_HASH:=c7ee6f1d5e98d86f191964e580111bfa71081ecbb3275cea035bbba177b73a29
+PKG_HASH:=73601f7ca13c6b534318d5b0648ec1833aa9ca0516d6c3f90085b090d548c50b
 
 PKG_INSTALL:=1
 
index cae24a8484eab6963a509ba16591be4452eeaeb8..c1b36c7dc1c95e547f1b97762b123ea43ea95966 100644 (file)
@@ -1,4 +1,4 @@
-@version:3.9
+@version: 3.17
 
 options {
        chain_hostnames(no);
diff --git a/admin/syslog-ng/patches/001-fix-compat-getent-musl.patch b/admin/syslog-ng/patches/001-fix-compat-getent-musl.patch
new file mode 100644 (file)
index 0000000..5df8263
--- /dev/null
@@ -0,0 +1,446 @@
+diff --git a/configure.ac b/configure.ac
+index 94f950c76..e3bda0599 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -783,6 +783,7 @@ AC_CHECK_FUNCS(strdup              \
+       strcasestr              \
+       memrchr                 \
+       localtime_r             \
++      getprotobynumber_r      \
+       gmtime_r                \
+       strnlen                 \
+       strtok_r)
+diff --git a/lib/compat/CMakeLists.txt b/lib/compat/CMakeLists.txt
+index 4fa05d7e0..95fcb0e0d 100644
+--- a/lib/compat/CMakeLists.txt
++++ b/lib/compat/CMakeLists.txt
+@@ -10,7 +10,8 @@ set(COMPAT_HEADERS
+     compat/openssl_support.h
+     compat/pcre.h
+     compat/getent.h
+-    compat/getent-bb.h
++    compat/getent-sun.h
++    compat/getent-generic.h
+     PARENT_SCOPE)
+ set(COMPAT_SOURCES
+@@ -24,7 +25,8 @@ set(COMPAT_SOURCES
+     compat/strnlen.c
+     compat/time.c
+     compat/openssl_support.c
+-    compat/getent.c
++    compat/getent-sun.c
++    compat/getent-generic.c
+     PARENT_SCOPE)
+ add_test_subdirectory(tests)
+diff --git a/lib/compat/Makefile.am b/lib/compat/Makefile.am
+index e5c1f4e56..8d5010558 100644
+--- a/lib/compat/Makefile.am
++++ b/lib/compat/Makefile.am
+@@ -13,9 +13,10 @@ compatinclude_HEADERS               =       \
+       lib/compat/string.h             \
+       lib/compat/time.h               \
+       lib/compat/openssl_support.h    \
+-      lib/compat/pcre.h       \
+-      lib/compat/getent.h     \
+-      lib/compat/getent-bb.h
++      lib/compat/pcre.h               \
++      lib/compat/getent.h             \
++      lib/compat/getent-sun.h         \
++      lib/compat/getent-generic.h
+ compat_sources                        =       \
+       lib/compat/getutent.c           \
+@@ -28,6 +29,7 @@ compat_sources                       =       \
+       lib/compat/strnlen.c            \
+       lib/compat/time.c               \
+       lib/compat/openssl_support.c    \
+-      lib/compat/getent.c
++      lib/compat/getent-sun.c         \
++      lib/compat/getent-generic.c
+ include lib/compat/tests/Makefile.am
+diff --git a/lib/compat/getent-generic.c b/lib/compat/getent-generic.c
+new file mode 100644
+index 000000000..f75d1cc0a
+--- /dev/null
++++ b/lib/compat/getent-generic.c
+@@ -0,0 +1,150 @@
++/*
++ * Copyright (c) 2017 Balabit
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
++ *
++ * As an additional exemption you are allowed to compile & link against the
++ * OpenSSL libraries as published by the OpenSSL project. See the file
++ * COPYING for details.
++ *
++ */
++
++#include "compat/getent-generic.h"
++
++#ifndef SYSLOG_NG_HAVE_GETPROTOBYNUMBER_R
++
++#include <glib.h>
++#include <errno.h>
++
++G_LOCK_DEFINE_STATIC(getproto);
++
++/* this code does not support proto aliases, as we wouldn't be using
++ * them anyway.  Should we ever want to support it, we would need to
++ * suballocate @buf and store all of the aliases in the same character
++ * array.
++ */
++static void
++_extract_protoent_fields(struct protoent *dst, struct protoent *src, char *buf, size_t buflen)
++{
++  g_strlcpy(buf, src->p_name, buflen);
++  dst->p_name = buf;
++  dst->p_aliases = NULL;
++  dst->p_proto = src->p_proto;
++}
++
++int
++_compat_generic__getprotobynumber_r(int proto,
++                                    struct protoent *result_buf, char *buf,
++                                    size_t buflen, struct protoent **result)
++{
++  struct protoent *pe;
++
++  G_LOCK(getproto);
++  pe = getprotobynumber(proto);
++
++  if (pe)
++    {
++      _extract_protoent_fields(result_buf, pe, buf, buflen);
++      *result = result_buf;
++      errno = 0;
++    }
++
++  G_UNLOCK(getproto);
++  return errno;
++}
++
++int
++_compat_generic__getprotobyname_r(const char *name,
++                                  struct protoent *result_buf, char *buf,
++                                  size_t buflen, struct protoent **result)
++{
++  struct protoent *pe;
++
++  G_LOCK(getproto);
++  pe = getprotobyname(name);
++
++  if (pe)
++    {
++      _extract_protoent_fields(result_buf, pe, buf, buflen);
++      *result = result_buf;
++      errno = 0;
++    }
++
++  G_UNLOCK(getproto);
++  return errno;
++}
++
++G_LOCK_DEFINE_STATIC(getserv);
++
++/* this code does not support service aliases or using the s_proto field, as
++ * we wouldn't be using them anyway.  Should we ever want to support it, we
++ * would need to suballocate @buf and store all of the aliases in the same
++ * character array.
++ */
++static void
++_extract_servent_fields(struct servent *dst, struct servent *src, char *buf, size_t buflen)
++{
++  g_strlcpy(buf, src->s_name, buflen);
++  dst->s_name = buf;
++  dst->s_aliases = NULL;
++  dst->s_port = src->s_port;
++  /* we don't support s_proto */
++  dst->s_proto = NULL;
++}
++
++
++int
++_compat_generic__getservbyport_r(int port, const char *proto,
++                                 struct servent *result_buf, char *buf,
++                                 size_t buflen, struct servent **result)
++{
++  struct servent *se;
++
++  G_LOCK(getserv);
++  se = getservbyport(port, proto);
++
++  if (se)
++    {
++      _extract_servent_fields(result_buf, se, buf, buflen);
++      *result = result_buf;
++      errno = 0;
++    }
++
++  G_UNLOCK(getserv);
++  return errno;
++}
++
++int
++_compat_generic__getservbyname_r(const char *name, const char *proto,
++                                 struct servent *result_buf, char *buf,
++                                 size_t buflen, struct servent **result)
++{
++  struct servent *se;
++
++  G_LOCK(getserv);
++  se = getservbyname(name, proto);
++
++  if (se)
++    {
++      _extract_servent_fields(result_buf, se, buf, buflen);
++      *result = result_buf;
++      errno = 0;
++    }
++
++  G_UNLOCK(getserv);
++  return errno;
++}
++
++#endif
+diff --git a/lib/compat/getent-generic.h b/lib/compat/getent-generic.h
+new file mode 100644
+index 000000000..cc95a2646
+--- /dev/null
++++ b/lib/compat/getent-generic.h
+@@ -0,0 +1,54 @@
++/*
++ * Copyright (c) 2017 Balabit
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
++ *
++ * As an additional exemption you are allowed to compile & link against the
++ * OpenSSL libraries as published by the OpenSSL project. See the file
++ * COPYING for details.
++ *
++ */
++
++#ifndef COMPAT_GETENT_GENERIC_H_INCLUDED
++#define COMPAT_GETENT_GENERIC_H_INCLUDED
++
++#include "compat/compat.h"
++
++#ifndef SYSLOG_NG_HAVE_GETPROTOBYNUMBER_R
++
++#include <sys/types.h>
++#include <grp.h>
++#include <pwd.h>
++#include <netdb.h>
++
++int _compat_generic__getprotobynumber_r(int proto,
++                                        struct protoent *result_buf, char *buf,
++                                        size_t buflen, struct protoent **result);
++
++int _compat_generic__getprotobyname_r(const char *name,
++                                      struct protoent *result_buf, char *buf,
++                                      size_t buflen, struct protoent **result);
++
++int _compat_generic__getservbyport_r(int port, const char *proto,
++                                     struct servent *result_buf, char *buf,
++                                     size_t buflen, struct servent **result);
++
++int _compat_generic__getservbyname_r(const char *name, const char *proto,
++                                     struct servent *result_buf, char *buf,
++                                     size_t buflen, struct servent **result);
++
++#endif
++
++#endif
+diff --git a/lib/compat/getent.c b/lib/compat/getent-sun.c
+similarity index 63%
+rename from lib/compat/getent.c
+rename to lib/compat/getent-sun.c
+index bb9b5b431..dce676f2f 100644
+--- a/lib/compat/getent.c
++++ b/lib/compat/getent-sun.c
+@@ -21,40 +21,45 @@
+  *
+  */
+-#if defined(sun) || defined(__sun)
++#include "compat/getent-sun.h"
+-#include "compat/getent-bb.h"
++#if defined(sun) || defined(__sun)
+ #include <errno.h>
+-int bb__getprotobynumber_r(int proto,
+-                           struct protoent *result_buf, char *buf,
+-                           size_t buflen, struct protoent **result)
++int
++_compat_sun__getprotobynumber_r(int proto,
++                                struct protoent *result_buf, char *buf,
++                                size_t buflen, struct protoent **result)
+ {
+   *result = getprotobynumber_r(proto, result_buf, buf, buflen);
+   return (*result ? NULL : errno);
+ }
+-int bb__getprotobyname_r(const char *name,
+-                         struct protoent *result_buf, char *buf,
+-                         size_t buflen, struct protoent **result)
++int
++_compat_sun__getprotobyname_r(const char *name,
++                              struct protoent *result_buf, char *buf,
++                              size_t buflen, struct protoent **result)
+ {
+   *result = getprotobyname_r(name, result_buf, buf, buflen);
+   return (*result ? NULL : errno);
+ }
+-int bb__getservbyport_r(int port, const char *proto,
+-                        struct servent *result_buf, char *buf,
+-                        size_t buflen, struct servent **result)
++int
++_compat_sun__getservbyport_r(int port, const char *proto,
++                             struct servent *result_buf, char *buf,
++                             size_t buflen, struct servent **result)
+ {
+   *result =  getservbyport_r(port, proto, result_buf, buf, buflen);
+   return (*result ? NULL : errno);
+ }
+-int bb__getservbyname_r(const char *name, const char *proto,
+-                        struct servent *result_buf, char *buf,
+-                        size_t buflen, struct servent **result)
++int
++_compat_sun__getservbyname_r(const char *name, const char *proto,
++                             struct servent *result_buf, char *buf,
++                             size_t buflen, struct servent **result)
+ {
+   *result =  getservbyname_r(name, proto, result_buf, buf, buflen);
+   return (*result ? NULL : errno);
+ }
++
+ #endif
+diff --git a/lib/compat/getent-bb.h b/lib/compat/getent-sun.h
+similarity index 53%
+rename from lib/compat/getent-bb.h
+rename to lib/compat/getent-sun.h
+index 15aa2f5e5..fc1eccd2c 100644
+--- a/lib/compat/getent-bb.h
++++ b/lib/compat/getent-sun.h
+@@ -21,8 +21,10 @@
+  *
+  */
+-#ifndef GETENT_BB_H_INCLUDED
+-#define GETENT_BB_H_INCLUDED
++#ifndef COMPAT_GETENT_SUN_H_INCLUDED
++#define COMPAT_GETENT_SUN_H_INCLUDED
++
++#include "compat/compat.h"
+ #if defined(sun) || defined(__sun)
+@@ -31,21 +33,21 @@
+ #include <pwd.h>
+ #include <netdb.h>
+-int bb__getprotobynumber_r(int proto,
+-                           struct protoent *result_buf, char *buf,
+-                           size_t buflen, struct protoent **result);
++int _compat_sun__getprotobynumber_r(int proto,
++                                    struct protoent *result_buf, char *buf,
++                                    size_t buflen, struct protoent **result);
+-int bb__getprotobyname_r(const char *name,
+-                         struct protoent *result_buf, char *buf,
+-                         size_t buflen, struct protoent **result);
++int _compat_sun__getprotobyname_r(const char *name,
++                                  struct protoent *result_buf, char *buf,
++                                  size_t buflen, struct protoent **result);
+-int bb__getservbyport_r(int port, const char *proto,
+-                        struct servent *result_buf, char *buf,
+-                        size_t buflen, struct servent **result);
++int _compat_sun__getservbyport_r(int port, const char *proto,
++                                 struct servent *result_buf, char *buf,
++                                 size_t buflen, struct servent **result);
+-int bb__getservbyname_r(const char *name, const char *proto,
+-                        struct servent *result_buf, char *buf,
+-                        size_t buflen, struct servent **result);
++int _compat_sun__getservbyname_r(const char *name, const char *proto,
++                                 struct servent *result_buf, char *buf,
++                                 size_t buflen, struct servent **result);
+ #endif
+diff --git a/lib/compat/getent.h b/lib/compat/getent.h
+index 09a9f73d6..01c3deb6d 100644
+--- a/lib/compat/getent.h
++++ b/lib/compat/getent.h
+@@ -21,22 +21,28 @@
+  *
+  */
+-#ifndef GETENT_COMPAT_H_INCLUDED
+-#define GETENT_COMPAT_H_INCLUDED
++#ifndef COMPAT_GETENT_H_INCLUDED
++#define COMPAT_GETENT_H_INCLUDED
+-#include <sys/types.h>
+-#include <grp.h>
+-#include <pwd.h>
+-#include <netdb.h>
++#include "compat/compat.h"
+-#if defined(sun) || defined(__sun)
++#ifndef SYSLOG_NG_HAVE_GETPROTOBYNUMBER_R
+-#define getprotobynumber_r bb__getprotobynumber_r
+-#define getprotobyname_r bb__getprotobyname_r
+-#define getservbyport_r bb__getservbyport_r
+-#define getservbyname_r bb__getservbyname_r
++#define getprotobynumber_r _compat_generic__getprotobynumber_r
++#define getprotobyname_r _compat_generic__getprotobyname_r
++#define getservbyport_r _compat_generic__getservbyport_r
++#define getservbyname_r _compat_generic__getservbyname_r
+-#include "getent-bb.h"
++#include "getent-generic.h"
+-#endif // Solaris
++#elif defined(sun) || defined(__sun)
++
++#define getprotobynumber_r _compat_sun__getprotobynumber_r
++#define getprotobyname_r _compat_sun__getprotobyname_r
++#define getservbyport_r _compat_sun__getservbyport_r
++#define getservbyname_r _compat_sun__getservbyname_r
++
++#include "getent-sun.h"
++
++#endif
+ #endif
diff --git a/admin/syslog-ng/patches/001-fix-secret-storage.patch b/admin/syslog-ng/patches/001-fix-secret-storage.patch
deleted file mode 100644 (file)
index b50c63f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -u --recursive syslog-ng-3.16.1-vanilla/configure.ac syslog-ng-3.16.1/configure.ac
---- syslog-ng-3.16.1-vanilla/configure.ac      2018-06-01 06:02:07.000000000 -0400
-+++ syslog-ng-3.16.1/configure.ac      2018-07-15 19:31:30.307354198 -0400
-@@ -793,6 +793,14 @@
- AC_CHECK_FUNCS([inotify_init])
- dnl ***************************************************************************
-+dnl secret-storage headers/libraries
-+dnl ***************************************************************************
-+
-+SECRET_STORAGE_LIBS="\$(top_builddir)/lib/secret-storage/libsecret-storage.la"
-+SECRET_STORAGE_NO_LIBTOOL_LIBS="\$(top_builddir)/lib/eventlog/src/.libs/libsecret-storage.so"
-+SECRET_STORAGE_CFLAGS="-I\$(top_srcdir)/lib/secret-storage"
-+
-+dnl ***************************************************************************
- dnl libevtlog headers/libraries (remove after relicensing libevtlog)
- dnl ***************************************************************************
-@@ -1592,7 +1600,7 @@
-       java_module_path="$moduledir"/java-modules
- fi
--CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $EVTLOG_CFLAGS $PCRE_CFLAGS $OPENSSL_CFLAGS $LIBNET_CFLAGS $LIBDBI_CFLAGS $IVYKIS_CFLAGS -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-+CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS $EVTLOG_CFLAGS $SECRET_STORAGE_CFLAGS $PCRE_CFLAGS $OPENSSL_CFLAGS $LIBNET_CFLAGS $LIBDBI_CFLAGS $IVYKIS_CFLAGS -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
- ########################################################
- ## NOTES: on how syslog-ng is linked
-@@ -1640,7 +1648,7 @@
- MODULE_DEPS_LIBS="\$(top_builddir)/lib/libsyslog-ng.la"
- if test "x$linking_mode" = "xdynamic"; then
--      SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $DL_LIBS"
-+      SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $SECRET_STORAGE_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $DL_LIBS"
-       if test "x$with_ivykis" = "xinternal"; then
-               # when using the internal ivykis, we're linking it statically into libsyslog-ng.so
-@@ -1659,8 +1667,8 @@
-       # syslog-ng binary is linked with the default link command (e.g. libtool)
-       SYSLOGNG_LINK='$(LINK)'
- else
--      SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $EVTLOG_NO_LIBTOOL_LIBS $LD_START_STATIC -Wl,${WHOLE_ARCHIVE_OPT} $GLIB_LIBS $PCRE_LIBS $REGEX_LIBS  -Wl,${NO_WHOLE_ARCHIVE_OPT} $IVYKIS_NO_LIBTOOL_LIBS $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS"
--      TOOL_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $IVYKIS_LIBS $DL_LIBS"
-+      SYSLOGNG_DEPS_LIBS="$LIBS $BASE_LIBS $RESOLV_LIBS $EVTLOG_NO_LIBTOOL_LIBS $SECRET_STORAGE_NO_LIBTOOL_LIBS $LD_START_STATIC -Wl,${WHOLE_ARCHIVE_OPT} $GLIB_LIBS $PCRE_LIBS $REGEX_LIBS  -Wl,${NO_WHOLE_ARCHIVE_OPT} $IVYKIS_NO_LIBTOOL_LIBS $LD_END_STATIC $LIBCAP_LIBS $DL_LIBS"
-+      TOOL_DEPS_LIBS="$LIBS $BASE_LIBS $GLIB_LIBS $EVTLOG_LIBS $SECRET_STORAGE_LIBS $RESOLV_LIBS $LIBCAP_LIBS $PCRE_LIBS $REGEX_LIBS $IVYKIS_LIBS $DL_LIBS"
-       CORE_DEPS_LIBS=""
-       # bypass libtool in case we want to do mixed linking because it
-Only in syslog-ng-3.16.1-vanilla/: syslog-ng-3.16.1
index 58a7e69fe9570bad0238247b59fd57b5b9bd40f7..e074cb3c4fc03cad5e716c85ca6ca911a1830fe6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=jamvm
 PKG_VERSION:=2.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0+
 PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
 
diff --git a/lang/jamvm/patches/001-Use-fenv.h-instead-of-fpu_control.h.patch b/lang/jamvm/patches/001-Use-fenv.h-instead-of-fpu_control.h.patch
new file mode 100644 (file)
index 0000000..50f95cd
--- /dev/null
@@ -0,0 +1,86 @@
+From 7152ded5219453c9ff1cd062cecbeaf4d77e4cab Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 26 May 2016 15:05:48 +0200
+Subject: [PATCH] Use <fenv.h> instead of <fpu_control.h>
+
+musl libc (http://musl-libc.org lack the non-standard <fpu_control.h>
+header, which is used in src/os/linux/{i386,x86_64}/init.c files to
+setup the floating point precision. This patch makes it use the
+standard C <fenv.h> header instead.
+
+Original patch at Felix Janda at
+https://sourceforge.net/p/jamvm/patches/6/.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ src/os/linux/i386/init.c   | 12 ++++++------
+ src/os/linux/x86_64/init.c | 16 ++++++----------
+ 2 files changed, 12 insertions(+), 16 deletions(-)
+
+diff --git a/src/os/linux/i386/init.c b/src/os/linux/i386/init.c
+index d9c6648..94a733e 100644
+--- a/src/os/linux/i386/init.c
++++ b/src/os/linux/i386/init.c
+@@ -19,18 +19,18 @@
+  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  */
+-#include <fpu_control.h>
++#include <fenv.h>
+ /* Change floating point precision to double (64-bit) from
+  * the extended (80-bit) Linux default. */
+ void setDoublePrecision() {
+-    fpu_control_t cw;
++    fenv_t fenv;
+-    _FPU_GETCW(cw);
+-    cw &= ~_FPU_EXTENDED;
+-    cw |= _FPU_DOUBLE;
+-    _FPU_SETCW(cw);
++    fegetenv(&fenv);
++    fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++    fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++    fesetenv(&fenv);
+ }
+ void initialisePlatform() {
+diff --git a/src/os/linux/x86_64/init.c b/src/os/linux/x86_64/init.c
+index 9d55229..a76a923 100644
+--- a/src/os/linux/x86_64/init.c
++++ b/src/os/linux/x86_64/init.c
+@@ -19,9 +19,7 @@
+  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  */
+-#ifdef __linux__
+-#include <fpu_control.h>
+-#endif
++#include <fenv.h>
+ /* Change the x87 FPU precision to double (64-bit) from the extended
+    (80-bit) Linux default.  Note, unlike on i386, my testcases pass
+@@ -30,14 +28,12 @@
+ */
+ void setDoublePrecision() {
+-#ifdef __linux__
+-    fpu_control_t cw;
++    fenv_t fenv;
+-    _FPU_GETCW(cw);
+-    cw &= ~_FPU_EXTENDED;
+-    cw |= _FPU_DOUBLE;
+-    _FPU_SETCW(cw);
+-#endif
++    fegetenv(&fenv);
++    fenv.__control_word &= ~0x300; /*_FPU_EXTENDED */
++    fenv.__control_word |= 0x200; /*_FPU_DOUBLE */
++    fesetenv(&fenv);
+ }
+ void initialisePlatform() {
+-- 
+2.7.4
+
index 19b3bdafd5e6ad544dc21a226aa9dd9e06c67a6f..3e1827ce5a6bcf1e8ec0d36b9d7f14cb550ac77a 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
 PKG_VERSION:=7.2.9
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
 
@@ -23,6 +23,7 @@ PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
 PHP7_MODULES = \
+       bcmath \
        calendar ctype curl \
        fileinfo \
        dom \
@@ -149,6 +150,22 @@ define Package/php7-mod-gd/config
        default y
 endef
 
+define Package/php7-mod-intl/config
+  config PHP7_FULLICUDATA
+       bool "Add dependency to full ICU Data"
+       depends on PACKAGE_php7-mod-intl
+       default n
+endef
+
+define Package/php7-mod-intl/description
+  Note that this package depends in ICU library which is built without data
+  by default. This is to satisfy programs build and run dependencies but to
+  keep the installed footprint small on the target system(s).
+  However, the data is required to make the ICU library useful - and thus
+  directly affects PHPs ICU extension, too - so consider to also
+  select/install package 'icu-full-data'.
+endef
+
 # not everything groks --disable-nls
 DISABLE_NLS:=
 
@@ -172,6 +189,12 @@ CONFIGURE_ARGS+= \
        --with-zlib="$(STAGING_DIR)/usr" \
          --with-zlib-dir="$(STAGING_DIR)/usr"
 
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-bcmath),)
+  CONFIGURE_ARGS+= --enable-bcmath=shared
+else
+  CONFIGURE_ARGS+= --disable-bcmath
+endif
+
 ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
   CONFIGURE_ARGS+= --enable-calendar=shared
 else
@@ -590,6 +613,7 @@ $(eval $(call BuildPackage,php7-fastcgi))
 $(eval $(call BuildPackage,php7-fpm))
 
 #$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
+$(eval $(call BuildModule,bcmath,Bcmath))
 $(eval $(call BuildModule,calendar,Calendar))
 $(eval $(call BuildModule,ctype,Ctype))
 $(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
@@ -603,14 +627,14 @@ $(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
 $(eval $(call BuildModule,hash,Hash))
 $(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
 $(eval $(call BuildModule,imap,IMAP,+PACKAGE_php7-mod-imap:libopenssl +PACKAGE_libpam:libpam +PACKAGE_php7-mod-imap:uw-imap))
-$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu))
+$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu +PHP7_FULLICUDATA:icu-full-data))
 $(eval $(call BuildModule,json,JSON))
 $(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
 $(eval $(call BuildModule,mbstring,MBString))
 $(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:php7-mod-mysqlnd,30))
 $(eval $(call BuildModule,mysqlnd,MySQL Native Driver,+php7-mod-hash))
 $(eval $(call BuildModule,opcache,OPcache,,,zend))
-$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl))
+$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl,15))
 $(eval $(call BuildModule,pcntl,PCNTL))
 $(eval $(call BuildModule,pdo,PHP Data Objects))
 $(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:php7-mod-mysqlnd))
index 4a0142f323ae41c745413f5dec7fa9bf6b92357f..aefb6ffe9e0a6cdb9fac2952621219ee9672fa1a 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flup
-PKG_VERSION:=1.0.2
+PKG_VERSION:=1.0.3
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-3-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
-PKG_HASH:=4bad317a5fc1ce3d4fe5e9b6d846ec38a8023e16876785d4f88102f2c8097dd9
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/f/flup
+PKG_HASH:=5eb09f26eb0751f8380d8ac43d1dfb20e1d42eca0fa45ea9289fa532a79cd159
 
 include $(INCLUDE_DIR)/package.mk
 include ../python-package.mk
@@ -25,7 +25,7 @@ define Package/flup
   CATEGORY:=Languages
   MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
   TITLE:=Random assortment of WSGI servers
-  URL:=http://www.saddi.com/software/flup/
+  URL:=https://www.saddi.com/software/flup/
   DEPENDS:=+python
 endef
 
index 2fba8a64d9c111365e45a90590e7d9a6a2340e85..e6c5e5f081db3cc3c45866f71ebe4c30d91de102 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=jdcal
-PKG_VERSION:=1.3
+PKG_VERSION:=1.4
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-3-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/9b/fa/40beb2aa43a13f740dd5be367a10a03270043787833409c61b79e69f1dfd/
-PKG_HASH:=b760160f8dc8cc51d17875c6b663fafe64be699e10ce34b6a95184b5aa0fdc9e
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/j/jdcal
+PKG_HASH:=ea0a5067c5f0f50ad4c7bdc80abad3d976604f6fb026b0b3a17a9d84bb9046c9
 
 include $(INCLUDE_DIR)/package.mk
 include ../python-package.mk
@@ -25,7 +25,7 @@ define Package/jdcal
   CATEGORY:=Languages
   MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
   TITLE:=Julian dates from proleptic Gregorian and Julian calendars.
-  URL:=http://github.com/phn/jdcal
+  URL:=https://github.com/phn/jdcal
   DEPENDS:=+python
 endef
 
index 28d2bd0dcecdf3872f673f34dfdff6966ce1679f..db1b14fdde88c244076d27529195558cd0b68cec 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-certifi
-PKG_VERSION:=2018.4.16
+PKG_VERSION:=2018.8.24
 PKG_RELEASE:=1
 PKG_LICENSE:=MPL-2.0
 
 PKG_SOURCE:=certifi-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/4d/9c/46e950a6f4d6b4be571ddcae21e7bc846fcbb88f1de3eff0f6dd0a6be55d
-PKG_HASH:=13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/c/certifi
+PKG_HASH:=376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638
 PKG_BUILD_DIR:=$(BUILD_DIR)/certifi-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
index fb8022b71c32385b56062f31d9ff2b89a2935bf5..33e3d4281433f6b1bf5b1e55652c23de23008489 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-cryptography
-PKG_VERSION:=2.2.2
+PKG_VERSION:=2.3.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=cryptography-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.io/packages/source/c/cryptography
-PKG_HASH:=9fc295bf69130a342e7a19a39d7bbeb15c0bcaabc7382ec33ef3b2b7d18d2f63
+PKG_SOURCE_URL:= https://files.pythonhosted.org/packages/source/c/cryptography
+PKG_HASH:=8d10113ca826a4c29d5b85b2c4e045ffa8bad74fb525ee0eceb1d38d4c70dfd6
 
 PKG_LICENSE:=Apache-2.0 BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD
index 421758a55a69dd4575dc6e59bf2b1f44695105de..dc3f4d107d7d4b79afc9812ebab802a88b6467b9 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-dateutil
-PKG_VERSION:=2.6.1
+PKG_VERSION:=2.7.3
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-2-Clause
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/54/bb/f1db86504f7a49e1d9b9301531181b00a1c7325dc85a29160ee3eaa73a54/
-PKG_HASH:=891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/python-dateutil
+PKG_HASH:=e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8
 
 include $(INCLUDE_DIR)/package.mk
 include ../python-package.mk
index 4bdf5212ffbbbb2a950bf598528e701bda89c67f..b9d14e887d2b504a3f32909ff29ced942810e22e 100644 (file)
@@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=python-evdev
-PKG_VERSION:=0.7.0
+PKG_VERSION:=1.1.2
 PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_MAINTAINER:=Paulo Costa <me@paulo.costa.nom.br>, Alexandru Ardelean <ardeleanalex@gmail.com>
 
 PKG_SOURCE:=evdev-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/67/15/eac376f3e1fc1960a54439c21459b2582e68340001aff83b4ace9e5bd110
-PKG_HASH:=57edafc469a414f58b51af1bfb9ee2babb9f626dd2df530d71c1176871850aa1
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/e/evdev
+PKG_HASH:=2dd67291be20e70643e8ef6f2381efc10e0c6e44a32abb3c1db74996ea3b0351
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)
 
index d564039b28c1aa5793158c2d7293ca784e8342fe..c18c0931ad89db9b2c323b559db08118ccdc416a 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-lxml
-PKG_VERSION:=4.2.1
+PKG_VERSION:=4.2.5
 PKG_RELEASE:=1
 
-PKG_SOURCE:=lxml-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://lxml.de/files/
-PKG_HASH:=e2629cdbcad82b83922a3488937632a4983ecc0fed3e5cfbf430d069382eeb9b
+PKG_SOURCE:=lxml-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/l/lxml
+PKG_HASH:=36720698c29e7a9626a0dc802ef8885f8f0239bfd1689628ecd459a061f2807f
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-lxml-$(PKG_VERSION)
 PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
@@ -30,7 +30,7 @@ define Package/python-lxml/Default
   SECTION:=lang
   CATEGORY:=Languages
   SUBMENU:=Python
-  URL:=http://lxml.de
+  URL:=https://lxml.de
   DEPENDS:=+libxml2 +libxslt +libexslt
 endef
 
index c1dc932c26da6cd7e0f0adf477c724cd91e0b615..5ac02e9bb45ef4b3a3443b7eb592b2330c7d87a6 100644 (file)
@@ -8,18 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-pcapy
-PKG_VERSION:=0.11.1
+PKG_VERSION:=0.11.4
 PKG_RELEASE:=1
+
+PKG_SOURCE:=pcapy-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/pcapy
+PKG_HASH:=aa239913678d7ba116e66057a37f914de7726aecd11d00db470127df115c4e78
+PKG_BUILD_DIR:=$(BUILD_DIR)/pcapy-$(PKG_VERSION)
+
 PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
 PKG_LICENSE:=Apache-1.1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=05c8d6978baa3512070ff4c041e5931384e702bbc2ac2c8063760176035958f1
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/CoreSecurity/pcapy.git
-PKG_SOURCE_VERSION:=b91a418374d1636408c435f11799ef725ef70097
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 include ../python-package.mk
 
index 7ad1e1f3576aabc1f2f20fad5191832cbe51bfd1..c6d708019eba892e23f990e86b42e2bf56d7a013 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-pyasn1-modules
-PKG_VERSION:=0.2.1
-PKG_RELEASE:=2
+PKG_VERSION:=0.2.2
+PKG_RELEASE:=1
 
 PKG_SOURCE:=pyasn1-modules-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/ab/76/36ab0e099e6bd27ed95b70c2c86c326d3affa59b9b535c63a2f892ac9f45
-PKG_HASH:=af00ea8f2022b6287dc375b2c70f31ab5af83989fc6fe9eacd4976ce26cd7ccc
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/pyasn1-modules
+PKG_HASH:=a0cf3e1842e7c60fde97cb22d275eb6f9524f5c5250489e292529de841417547
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE.txt
index 5c277242fbe878c1c69670057bbd0aa73156f5a9..fcaf6b7ab6aef30e17539e8211e5fc4ca437478d 100644 (file)
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
 
 PKG_NAME:=python3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
diff --git a/lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch b/lang/python/python3/patches/002-fix-implicit-dh-free-declaration.patch
new file mode 100644 (file)
index 0000000..46cfa9b
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index 2bce4816d2..3c93884809 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -63,6 +63,7 @@ static PySocketModule_APIObject PySocketModule;
+ #include "openssl/err.h"
+ #include "openssl/rand.h"
+ #include "openssl/bio.h"
++#include "openssl/dh.h"
+ #ifndef HAVE_X509_VERIFY_PARAM_SET1_HOST
+ #  ifdef LIBRESSL_VERSION_NUMBER
index 464ed78163934349cd3be75278911219a55afa01..38835ee17532f01591d274a6897f3eb66c883dd1 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pytz
-PKG_VERSION:=2018.3
+PKG_VERSION:=2018.5
 PKG_RELEASE:=1
 PKG_LICENSE:=MIT
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/1b/50/4cdc62fc0753595fc16c8f722a89740f487c6e5670c644eb8983946777be/
-PKG_HASH:=410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0
+PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/p/pytz
+PKG_HASH:=ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277
 
 include $(INCLUDE_DIR)/package.mk
 include ../python-package.mk
index a9e768dd55e89ff99f1ad5d336676d54da58451e..8fdd15590cb4c08380d8e0d5d2a61d371dccd0d5 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2015-2018 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -18,7 +16,7 @@ include $(INCLUDE_DIR)/target.mk
 PKG_NAME:=boost
 PKG_VERSION:=1.68.0
 PKG_SOURCE_VERSION:=1_68_0
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_NAME)/$(PKG_VERSION) https://dl.bintray.com/boostorg/release/$(PKG_VERSION)/source/
@@ -28,7 +26,7 @@ PKG_HASH:=7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7
 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
 
-PKG_BUILD_PARALLEL:=0
+PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
@@ -235,6 +233,11 @@ define Package/boost/config
                        select boost-coroutine2
                        select boost-graph-parallel
 
+               # Invisible config dependency
+               config boost-fiber-exclude
+                       bool
+                       default y if (CPU_TYPE=mips32 || CPU_TYPE=mips64)
+
                config boost-test-pkg
                        bool "Boost test package."
                        default m if ALL
@@ -256,8 +259,8 @@ define Package/boost/config
                        prompt "Boost $(lib) library."
                        default m if ALL
                        $(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
-                       $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)
-
+                       $(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)\
+                       $(if $(findstring fiber,$(lib)),depends on (CPU_TYPE!=mips32 && CPU_TYPE!=mips64),)
                )
        endmenu
 
@@ -306,7 +309,7 @@ $(eval $(call DefineBoostLibrary,contract,system,))
 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
 $(eval $(call DefineBoostLibrary,date_time,,))
 #$(eval $(call DefineBoostLibrary,exception,,))
-$(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,))
+$(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
 $(eval $(call DefineBoostLibrary,filesystem,system,))
 $(eval $(call DefineBoostLibrary,graph,regex,))
 $(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2))
@@ -361,7 +364,7 @@ endif
 comma := ,
 
 define Build/Compile
-       $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
+       $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CONFIG_CPU_TYPE) and cpu subtype $(CONFIG_CPU_SUBTYPE))
        ( cd $(PKG_BUILD_DIR) ; \
                echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
                $(if $(CONFIG_PACKAGE_boost-python3), \
index b795ec9d7d9e8b5f5c70e04f0d6cdae2601ca0cf..39a8dbcb7118aca70b5530e0b5cfb7e695ee6773 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=classpath
 PKG_VERSION:=0.99
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
 
diff --git a/libs/classpath/patches/020-fix-statement-may-fall-through.patch b/libs/classpath/patches/020-fix-statement-may-fall-through.patch
new file mode 100644 (file)
index 0000000..b315757
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/native/jni/java-math/gnu_java_math_GMP.c
++++ b/native/jni/java-math/gnu_java_math_GMP.c
+@@ -1132,6 +1132,7 @@
+         break;
+       case 1:
+         res = mpz_popcount (_this);
++      __attribute__((fallthrough));
+       default:
+         JCL_ThrowException (env, "java/lang/Error",
+                             "Unexpected sign value for a native MPI");
index 9ac94b26230de9659e2bc6c53bb06b2d3cc329be..52e7133366b41a590800e1594f3388527a085aac 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=expat
-PKG_VERSION:=2.2.5
+PKG_VERSION:=2.2.6
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/expat
-PKG_HASH:=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+PKG_HASH:=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>, \
                Ted Hess <thess@kitschensync.net>
 
@@ -41,7 +41,11 @@ TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
        --enable-shared \
-       --enable-static
+       --enable-static \
+       --without-docbook
+
+HOST_CONFIGURE_ARGS += \
+       --without-docbook
 
 define Host/Install
        $(MAKE) -C $(HOST_BUILD_DIR) install
index 3f1d014482e08c9536ff5cdd4c611fdebec4f3d1..f434d08b09435e85545ddf505af91b2220dc05bc 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glib2
-PKG_VERSION:=2.56.1
+PKG_VERSION:=2.56.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
 PKG_SOURCE_URL:=@GNOME/glib/2.56
-PKG_HASH:=40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d
+PKG_HASH:=d64abd16813501c956c4e123ae79f47f1b58de573df9fdd3b0795f1e2c1aa789
 
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
@@ -53,10 +53,12 @@ HOST_CONFIGURE_ARGS += \
 CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
-       --enable-debug=no \
+       --disable-debug \
        --disable-selinux \
-       --enable-libmount=no \
+       --disable-libmount \
        --disable-fam \
+       --disable-gtk-doc-html \
+       --disable-man \
        --with-libiconv=gnu \
        --with-pcre=internal
 
diff --git a/libs/hwloc/Makefile b/libs/hwloc/Makefile
new file mode 100644 (file)
index 0000000..bf2dbfa
--- /dev/null
@@ -0,0 +1,92 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hwloc
+PKG_VERSION:=2.0.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://download.open-mpi.org/release/$(PKG_NAME)/v2.0/
+PKG_HASH:=f1156df22fc2365a31a3dc5f752c53aad49e34a5e22d75ed231cd97eaa437f9d
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_INSTALL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hwloc/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Portable Hardware Locality
+  URL:=https://www.open-mpi.org/projects/hwloc/
+endef
+
+define Package/hwloc/Default/description
+  The Portable Hardware Locality (hwloc) software package provides a
+  portable abstraction (across OS, versions, architectures, ...) of the
+  hierarchical topology of modern architectures, including NUMA memory
+  nodes, sockets, shared caches, cores and simultaneous multithreading. It
+  also gathers various system attributes such as cache and memory
+  information as well as the locality of I/O devices such as network
+  interfaces, InfiniBand HCAs or GPUs.
+endef
+
+define Package/hwloc-utils
+$(call Package/hwloc/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE+= utilities
+  DEPENDS+= +libhwloc
+endef
+
+define Package/hwloc-utils/description
+$(call Package/hwloc/Default/description)
+  This package contains the hwloc utilities.
+endef
+
+define Package/libhwloc
+$(call Package/hwloc/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= libraries
+endef
+
+define Package/libhwloc/description
+$(call Package/hwloc/Default/description)
+  This package contains the hwloc libraries.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hwloc.h $(STAGING_DIR)/usr/include/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include/hwloc
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hwloc/*.h $(STAGING_DIR)/usr/include/hwloc/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/include/hwloc/autogen
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hwloc/autogen/*.h $(STAGING_DIR)/usr/include/hwloc/autogen/
+       $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(STAGING_DIR)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig
+endef
+
+define Package/hwloc-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+define Package/libhwloc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,hwloc-utils))
+$(eval $(call BuildPackage,libhwloc))
index 6cfd23b6cf4089b3996bf4c81261f87f07edb7cb..c847842458eec81045f783af90a9e29f59243f63 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=icu4c
 PKG_VERSION:=62.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-62_1-src.tgz
 PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)
@@ -40,6 +40,37 @@ define Package/icu
   DEPENDS:=+libstdcpp +libpthread
 endef
 
+define Package/icu/description
+  ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. ICU is widely portable and gives applications the same results on all platforms and between C/C++ and Java software.
+  This package supports C/C++.
+endef
+
+define Package/icu-full-data
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Full ICU Data
+  URL:=http://icu-project.org
+  DEPENDS:=+icu
+endef
+
+define Package/icu-full-data/description
+  ICU makes use of a wide variety of data tables to provide many of its services. Examples include converter mapping tables, collation rules, transliteration rules, break iterator rules and dictionaries, and other locale data.
+  This package contains the complete data library provided by ICU.
+  A custom data library can be generated at http://apps.icu-project.org/datacustom/
+endef
+
+define Package/icu-data-tools
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=ICU Data manipulation tools
+  URL:=http://icu-project.org
+  DEPENDS:=+icu
+endef
+
+define Package/icu-data-tools/description
+ This package provides tools for manipulating ICU data.
+endef
+
 CONFIGURE_CMD:= ./runConfigureICU
 CONFIGURE_ARGS:= \
        Linux/gcc \
@@ -57,7 +88,7 @@ CONFIGURE_ARGS:= \
        --disable-tracing \
        --disable-extras \
        --enable-dyload \
-       --disable-tools \
+       --with-data-packaging=archive \
        --disable-tests \
        --disable-samples \
        --with-cross-build="$(STAGING_DIR_HOSTPKG)/share/icu/$(PKG_VERSION)" \
@@ -105,5 +136,20 @@ define Package/icu/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
 endef
 
-$(eval $(call BuildPackage,icu))
+define Package/icu-full-data/install
+       $(INSTALL_DIR)  $(1)/usr/share/icu/$(PKG_VERSION)
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/icu/$(PKG_VERSION)/icudt*.dat \
+               $(1)/usr/share/icu/$(PKG_VERSION)/
+endef
+
+define Package/icu-data-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+endef
+
 $(eval $(call HostBuild))
+$(eval $(call BuildPackage,icu))
+$(eval $(call BuildPackage,icu-full-data))
+$(eval $(call BuildPackage,icu-data-tools))
diff --git a/libs/keyutils/Makefile b/libs/keyutils/Makefile
new file mode 100644 (file)
index 0000000..91b5ca8
--- /dev/null
@@ -0,0 +1,47 @@
+# 
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=keyutils
+PKG_VERSION:=1.5.10
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://people.redhat.com/dhowells/keyutils/
+PKG_HASH:=115c3deae7f181778fd0e0ffaa2dad1bf1fe2f5677cf2e0e348cdb7a1c93afb6
+
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libkeyutils
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Key utilities library
+  URL:=http://people.redhat.com/dhowells/keyutils/
+endef
+
+define Package/keyutils/description
+  Key utilities library
+endef
+
+define Build/Install
+       make -C $(PKG_BUILD_DIR) DESTDIR=$(PKG_INSTALL_DIR) LIBDIR=/usr/lib install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libkeyutils.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libkeyutils/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libkeyutils.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libkeyutils))
diff --git a/libs/keyutils/patches/03-cifs.patch b/libs/keyutils/patches/03-cifs.patch
new file mode 100644 (file)
index 0000000..6d87633
--- /dev/null
@@ -0,0 +1,13 @@
+Author: Marcus Meissner <meissner@suse.de>
+Description: Added 2 cifs helpers to request-key.conf (for CIFS DFS support)
+
+diff -Naurp keyutils.orig/request-key.conf keyutils/request-key.conf
+--- keyutils.orig/request-key.conf     2011-08-22 11:46:30.332025250 +0200
++++ keyutils/request-key.conf  2011-08-22 11:49:40.096967441 +0200
+@@ -38,4 +38,6 @@ create  user    debug:*         expired
+ create  user    debug:*         revoked         /bin/keyctl reject %k 30 %c %S
+ create        user    debug:loop:*    *               |/bin/cat
+ create        user    debug:*         *               /usr/share/keyutils/request-key-debug.sh %k %d %c %S
++create        cifs.spnego     *       *               /usr/sbin/cifs.upcall -c %k
++create        dns_resolver    *       *               /usr/sbin/cifs.upcall %k
+ negate        *       *               *               /bin/keyctl negate %k 30 %S
diff --git a/libs/keyutils/patches/04-cflags.patch b/libs/keyutils/patches/04-cflags.patch
new file mode 100644 (file)
index 0000000..44f4baa
--- /dev/null
@@ -0,0 +1,19 @@
+Author: Nobuhiro Iwamatsu <iwamatsu@debian.org>
+Description: Avoid setting Intel Architecture specific CFLAGS (Closes: #638925).
+
+diff -Naurp keyutils.orig/Makefile keyutils/Makefile
+--- keyutils.orig/Makefile     2011-08-22 11:51:20.521464216 +0200
++++ keyutils/Makefile  2011-08-24 19:17:09.855361713 +0200
+@@ -56,12 +56,10 @@ BUILDFOR   := $(shell file /usr/bin/make |
+ LNS           := ln -sf
+ ifeq ($(BUILDFOR),32-bit)
+-CFLAGS                += -m32
+ LIBDIR                := /lib
+ USRLIBDIR     := /usr/lib
+ else
+ ifeq ($(BUILDFOR),64-bit)
+-CFLAGS                += -m64
+ LIBDIR                := /lib64
+ USRLIBDIR     := /usr/lib64
+ endif
index d2751c0d3b0e07bb2629785a04897d6e5057ec2d..845bfff40bc47d0db9394d049ab3eb914b04e675 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ldns
 PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
@@ -17,7 +17,7 @@ PKG_HASH:=c19f5b1b4fb374cfe34f4845ea11b1e0551ddc67803bd6ddd5d2a20f0997a6cc
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/libs/ldns/patches/100-CVE-2017-1000231.patch b/libs/ldns/patches/100-CVE-2017-1000231.patch
new file mode 100644 (file)
index 0000000..2c2abe8
--- /dev/null
@@ -0,0 +1,28 @@
+From c8391790c96d4c8a2c10f9ab1460fda83b509fc2 Mon Sep 17 00:00:00 2001
+From: Willem Toorop <willem@nlnetlabs.nl>
+Date: Thu, 27 Apr 2017 00:14:58 +0200
+Subject: [PATCH] Check parse limit before t increment
+
+Thanks Stephan Zeisberg
+---
+ parse.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/parse.c b/parse.c
+index e68627c..947dbb8 100644
+--- a/parse.c
++++ b/parse.c
+@@ -118,6 +118,10 @@ ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *li
+                       if (line_nr) {
+                               *line_nr = *line_nr + 1;
+                       }
++                      if (limit > 0 && (i >= limit || (size_t)(t-token) >= limit)) {
++                              *t = '\0';
++                              return -1;
++                      }
+                       *t++ = ' ';
+                       prev_c = c;
+                       continue;
+-- 
+2.9.5
+
diff --git a/libs/ldns/patches/101-CVE-2017-1000232.patch b/libs/ldns/patches/101-CVE-2017-1000232.patch
new file mode 100644 (file)
index 0000000..25be44d
--- /dev/null
@@ -0,0 +1,30 @@
+From 3bdeed02505c9bbacb3b64a97ddcb1de967153b7 Mon Sep 17 00:00:00 2001
+From: Willem Toorop <willem@nlnetlabs.nl>
+Date: Thu, 27 Apr 2017 00:25:20 +0200
+Subject: [PATCH] bugfix #1257: Free after reallocing to 0 size
+
+Thanks Stephan Zeisberg
+---
+ str2host.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/str2host.c b/str2host.c
+index b274b17..f2a317b 100644
+--- a/str2host.c
++++ b/str2host.c
+@@ -1525,8 +1525,10 @@ ldns_str2rdf_long_str(ldns_rdf **rd, const char *str)
+       if (! str) {
+               return LDNS_STATUS_SYNTAX_BAD_ESCAPE;
+       }
+-      length = (size_t)(dp - data);
+-
++      if (!(length = (size_t)(dp - data))) {
++              LDNS_FREE(data);
++              return LDNS_STATUS_SYNTAX_EMPTY;
++      }
+       /* Lose the overmeasure */
+       data = LDNS_XREALLOC(dp = data, uint8_t, length);
+       if (! data) {
+-- 
+2.9.5
+
diff --git a/libs/libcups/Makefile b/libs/libcups/Makefile
new file mode 100644 (file)
index 0000000..892182f
--- /dev/null
@@ -0,0 +1,93 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2017-2018 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cups
+PKG_VERSION:=2.2.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.tar.gz
+PKG_SOURCE_URL:=https://github.com/apple/cups/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=3968fc1d26fc48727508db1c1380e36c6694ab90177fd6920aec5f6cc73af9e4
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE.txt
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libcups/Default
+  URL:=http://www.cups.org/
+  SUBMENU:=Printing
+endef
+
+define Package/libcups
+$(call Package/cups/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+zlib +libpthread +libpng +libjpeg +libusb-1.0
+  TITLE:=Common UNIX Printing System - Core library
+endef
+
+define Package/libcups/description
+       Common UNIX Printing System - Core library
+endef
+
+TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+CONFIGURE_ARGS+=--with-cups-user="nobody" \
+               --with-cups-group="nogroup" \
+               --with-components="core" \
+               --with-pdftops="none" \
+               --without-perl \
+               --without-python \
+               --without-php \
+               --enable-shared \
+               --enable-image \
+               --enable-libusb \
+               --disable-acl \
+               --disable-dbus \
+               --disable-dnssd \
+               --disable-launchd \
+               --disable-ldap \
+               --disable-pam \
+               --disable-slp \
+               --disable-gnutls \
+               --disable-openssl \
+               --disable-cdsassl \
+               --disable-ssl \
+               --disable-gssapi \
+               --disable-tiff \
+               UNAME="Linux" \
+               LIBS="$(TARGET_LDFLAGS) -lz -lpng -ljpeg"
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/cups \
+               $(TARGET_CONFIGURE_OPTS) \
+               DSTROOT="$(PKG_INSTALL_DIR)" \
+               STRIP="/bin/true" \
+               libcups.so.2 install-libs install-headers
+       $(MAKE) -C $(PKG_BUILD_DIR)/filter \
+               $(TARGET_CONFIGURE_OPTS) \
+               DSTROOT="$(PKG_INSTALL_DIR)" \
+               STRIP="/bin/true" \
+               libcupsimage.so.2 install-libs install-headers
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cups-config $(PKG_INSTALL_DIR)/usr/bin
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cups-config $(2)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/cups $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libcups))
index 1f38900f274ad8ce3715eb2eb913773b44d9c8be..6750af629616517f22cb616608f5b549d5570e5f 100644 (file)
@@ -10,7 +10,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libdmapsharing
-PKG_VERSION:=3.9.2
+PKG_VERSION:=3.9.3
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.flyn.org/projects/libdmapsharing/
-PKG_HASH:=377276d99799945dcfd241ecc8c93f49adbd6d95483360b4c0ebc949b2d86d2a
+PKG_HASH:=a19df4b6fbd669fc95824860c235aa4aed33b69ecc25eb9d9d6dccb4e98c3f18
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index e8974e02adb99af336e208b26f47d7e14f6ba7d4..c54e7efce6cf6f0e67b743d17757ae1e246f2772 100644 (file)
@@ -8,21 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libfastjson
-PKG_VERSION:=0.99.2
-PKG_RELEASE:=2
+PKG_VERSION:=0.99.8
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=66676a4c8de8c5399dfe1cfd064d140afca58e3d8187bae0a3dccdf83165d9d1
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/rsyslog/libfastjson.git
-PKG_SOURCE_VERSION:=v$(PKG_VERSION)
+PKG_SOURCE_URL:=http://download.rsyslog.com/libfastjson
+PKG_HASH:=3544c757668b4a257825b3cbc26f800f59ef3c1ff2a260f40f96b48ab1d59e07
 
 PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 
-PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
index 7e151a84072c0e63aafc962e7a8e6e64a2ba231f..1f5e0c60725afed554fdc83f0106e41ea011e8a0 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libfmt
-PKG_VERSION:=5.1.0
+PKG_VERSION:=5.2.0
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://github.com/fmtlib/fmt.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_MIRROR_HASH:=458debd5a0fbfdc36715ce63a0c1b1be84140ee9fbe28232a27c90448630469c
+PKG_MIRROR_HASH:=2cfc3c44cd59660379a75a67f8931dab2109eb71597da25e364f46cc0da1c183
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
 PKG_LICENSE:=BSD-2-Clause
index 35c3bf006145760947cb8eedf48c6d04b0c9daad..fddf4034134c85ac7efca0a4592c5d96e6bdfd11 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libftdi1
 PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
diff --git a/libs/libftdi1/patches/101-use-findSWIG.patch b/libs/libftdi1/patches/101-use-findSWIG.patch
new file mode 100644 (file)
index 0000000..91542ca
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/python/CMakeLists.txt
++++ b/python/CMakeLists.txt
+@@ -3,7 +3,7 @@ option ( LINK_PYTHON_LIBRARY "Link again
+ if ( PYTHON_BINDINGS )
+   # workaround for cmake bug #0013449
+-  if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
++  if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0 )
+     find_package ( SWIG )
+   else ()
+     find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
index fc48925c2775d3b76b25ec048bccfbae59b61277..18126dbfe74bc1b62e1d671ee00976a6d78532c4 100644 (file)
@@ -8,16 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpng
-PKG_VERSION:=1.6.34
+PKG_VERSION:=1.6.35
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/libpng
-PKG_HASH:=2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6
+PKG_HASH:=23912ec8c9584917ed9b09c5023465d71709dce089be503c7867fec68a93bcd7
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 PKG_LICENSE:=Libpng GPL-2.0+ BSD-3-Clause
 PKC_LICENSE_FILES:=LICENSE contrib/gregbook/COPYING contrib/gregbook/LICENSE
+PKG_CPE_ID:=cpe:/a:libpng:libpng
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 4b0b576a28c78060a4de6dabca331691d9849c05..9817f0eb57085c46eeb76886c35d2c8038783042 100644 (file)
@@ -8,18 +8,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libseccomp
-PKG_VERSION:=2.2.1
+PKG_VERSION:=2.3.3
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/seccomp/libseccomp/releases/download/v$(PKG_VERSION)/
-PKG_HASH:=0ba1789f54786c644af54cdffc9fd0dd0a8bb2b2ee153933f658855d2851a740
+PKG_HASH:=7fc28f4294cc72e61c529bedf97e705c3acf9c479a8f1a3028d4cd2ca9f3b155
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 PKG_LIBTOOL_PATHS:=. lib
-PKG_CHECK_FORMAT_SECURITY:=0
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_KERNEL_SECCOMP
diff --git a/libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch b/libs/libseccomp/patches/100-dont-use-linux-prctl.h-with-musl.patch
deleted file mode 100644 (file)
index 4093ca3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: libseccomp-2.2.1/src/system.h
-===================================================================
---- libseccomp-2.2.1.orig/src/system.h
-+++ libseccomp-2.2.1/src/system.h
-@@ -23,7 +23,9 @@
- #define _SYSTEM_H
- #include <linux/filter.h>
-+#ifdef __GLIBC__
- #include <linux/prctl.h>
-+#endif
- #include "configure.h"
index e5ca3e59856c1a9335d86892ebf1a8d4c932951a..5c0e4917cdd1fb3cec9d24622278647cfef71edd 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2016 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -10,13 +8,13 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=talloc
 PKG_VERSION:=2.1.14
 MAJOR_VERSION:=2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.samba.org/ftp/talloc
 PKG_HASH:=b185602756a628bac507fa8af8b9df92ace69d27c0add5dab93190ad7c3367ce
 
-PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=LGPL-3.0+
 
 PKG_BUILD_PARALLEL:=0
@@ -28,7 +26,7 @@ define Package/libtalloc
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=Core memory allocator used in Samba
-  DEPENDS:=+USE_GLIBC:libbsd $(ICONV_DEPENDS) +libattr
+  DEPENDS:=$(ICONV_DEPENDS) +libattr
   URL:=https://talloc.samba.org/talloc/doc/html/index.html
 endef
 
diff --git a/libs/libtalloc/patches/100-Remove_libbsd_dependency_check.patch b/libs/libtalloc/patches/100-Remove_libbsd_dependency_check.patch
new file mode 100644 (file)
index 0000000..c98435a
--- /dev/null
@@ -0,0 +1,58 @@
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -340,22 +340,13 @@ def configure(conf):
+     conf.CHECK_FUNCS('prctl dirname basename')
+-    strlcpy_in_bsd = False
++    # Not checking for libbsd
++    conf.CHECK_FUNCS('strlcpy strlcat')
++    conf.CHECK_FUNCS('getpeereid')
++    conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
++    conf.CHECK_FUNCS('setproctitle_init')
+-    # libbsd on some platforms provides strlcpy and strlcat
+-    if not conf.CHECK_FUNCS('strlcpy strlcat'):
+-        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+-                               checklibc=True):
+-            strlcpy_in_bsd = True
+-    if not conf.CHECK_FUNCS('getpeereid'):
+-        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+-        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS('setproctitle_init'):
+-        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+-    if not conf.CHECK_FUNCS('closefrom'):
+-        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++    conf.CHECK_FUNCS('closefrom')
+     conf.CHECK_CODE('''
+                 struct ucred cred;
+@@ -698,9 +689,6 @@ def configure(conf):
+     # look for a method of finding the list of network interfaces
+     for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+-        bsd_for_strlcpy = ''
+-        if strlcpy_in_bsd:
+-            bsd_for_strlcpy = ' bsd'
+         if conf.CHECK_CODE('''
+                            #define %s 1
+                            #define NO_CONFIG_H 1
+@@ -713,7 +701,7 @@ def configure(conf):
+                            #include "test/getifaddrs.c"
+                            ''' % method,
+                            method,
+-                           lib='nsl socket' + bsd_for_strlcpy,
++                           lib='nsl socket',
+                            addmain=False,
+                            execute=True):
+             break
+@@ -761,7 +749,6 @@ def build(bld):
+                 break
+     extra_libs = ''
+-    if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
+     bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+         REPLACE_HOSTCC_SOURCE,
index 9e50f0b4f8105f22123151ef7d461d8454d23275..d7c8cd25bbec78e266fc35df10bc7dbf6163c15c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libtirpc
-PKG_VERSION:=1.0.3
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.4
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@SF/libtirpc
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=86c3a78fc1bddefa96111dd233124c703b22a78884203c55c3e06b3be6a0fd5e
+PKG_HASH:=2ca529f02292e10c158562295a1ffd95d2ce8af97820e3534fe1b0e3aec7561d
 
 PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
diff --git a/libs/libtirpc/patches/002-libtirpc-1.0.4-rc2.patch b/libs/libtirpc/patches/002-libtirpc-1.0.4-rc2.patch
deleted file mode 100644 (file)
index 35b38cf..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-diff --git a/src/clnt_dg.c b/src/clnt_dg.c
-index 04a2aba..eb5467f 100644
---- a/src/clnt_dg.c
-+++ b/src/clnt_dg.c
-@@ -160,15 +160,22 @@ clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz)
-       thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
-       mutex_lock(&clnt_fd_lock);
-       if (dg_fd_locks == (int *) NULL) {
--              int cv_allocsz;
--              size_t fd_allocsz;
--              int dtbsize = __rpc_dtbsize();
-+              size_t cv_allocsz, fd_allocsz;
-+              unsigned int dtbsize = __rpc_dtbsize();
-+
-+              if ( (size_t) dtbsize > SIZE_MAX/sizeof(cond_t)) {
-+                      mutex_unlock(&clnt_fd_lock);
-+                      thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      errno = EOVERFLOW;
-+                      goto err1;
-+              }
-               fd_allocsz = dtbsize * sizeof (int);
-               dg_fd_locks = (int *) mem_alloc(fd_allocsz);
-               if (dg_fd_locks == (int *) NULL) {
-                       mutex_unlock(&clnt_fd_lock);
-                       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      errno = ENOMEM;
-                       goto err1;
-               } else
-                       memset(dg_fd_locks, '\0', fd_allocsz);
-@@ -180,6 +187,7 @@ clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz)
-                       dg_fd_locks = (int *) NULL;
-                       mutex_unlock(&clnt_fd_lock);
-                       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      errno = ENOMEM;
-                       goto err1;
-               } else {
-                       int i;
-diff --git a/src/clnt_generic.c b/src/clnt_generic.c
-index e5a314f..3f3dabf 100644
---- a/src/clnt_generic.c
-+++ b/src/clnt_generic.c
-@@ -47,7 +47,6 @@
- extern bool_t __rpc_is_local_host(const char *);
- int __rpc_raise_fd(int);
--extern int __binddynport(int fd);
- #ifndef NETIDLEN
- #define       NETIDLEN 32
-@@ -341,8 +340,7 @@ clnt_tli_create(int fd, const struct netconfig *nconf,
-               servtype = nconf->nc_semantics;
-               if (!__rpc_fd2sockinfo(fd, &si))
-                       goto err;
--              if (__binddynport(fd) == -1)
--                      goto err;
-+              bindresvport(fd, NULL);
-       } else {
-               if (!__rpc_fd2sockinfo(fd, &si))
-                       goto err;
-diff --git a/src/clnt_vc.c b/src/clnt_vc.c
-index 6098c3a..3d775c7 100644
---- a/src/clnt_vc.c
-+++ b/src/clnt_vc.c
-@@ -63,6 +63,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <signal.h>
-+#include <stdint.h>
- #include <rpc/rpc.h>
- #include "rpc_com.h"
-@@ -201,14 +202,25 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
-       thr_sigsetmask(SIG_SETMASK, &newmask, &mask);
-       mutex_lock(&clnt_fd_lock);
-       if (vc_fd_locks == (int *) NULL) {
--              int cv_allocsz, fd_allocsz;
--              int dtbsize = __rpc_dtbsize();
-+              size_t cv_allocsz, fd_allocsz;
-+              unsigned int dtbsize = __rpc_dtbsize();
-+              struct rpc_createerr *ce = &get_rpc_createerr();
-+
-+              if ( (size_t) dtbsize > SIZE_MAX/sizeof(cond_t)) {
-+                      mutex_unlock(&clnt_fd_lock);
-+                      thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      ce->cf_stat = RPC_SYSTEMERROR;
-+                      ce->cf_error.re_errno = EOVERFLOW;
-+                      goto err;
-+              }
-               fd_allocsz = dtbsize * sizeof (int);
-               vc_fd_locks = (int *) mem_alloc(fd_allocsz);
-               if (vc_fd_locks == (int *) NULL) {
-                       mutex_unlock(&clnt_fd_lock);
-                       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      ce->cf_stat = RPC_SYSTEMERROR;
-+                      ce->cf_error.re_errno = ENOMEM;
-                       goto err;
-               } else
-                       memset(vc_fd_locks, '\0', fd_allocsz);
-@@ -221,6 +233,8 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
-                       vc_fd_locks = (int *) NULL;
-                       mutex_unlock(&clnt_fd_lock);
-                       thr_sigsetmask(SIG_SETMASK, &(mask), NULL);
-+                      ce->cf_stat = RPC_SYSTEMERROR;
-+                      ce->cf_error.re_errno = ENOMEM;
-                       goto err;
-               } else {
-                       int i;
-diff --git a/src/rpc_soc.c b/src/rpc_soc.c
-index af6c482..5a6eeb7 100644
---- a/src/rpc_soc.c
-+++ b/src/rpc_soc.c
-@@ -67,8 +67,6 @@
- extern mutex_t        rpcsoc_lock;
--extern int __binddynport(int fd);
--
- static CLIENT *clnt_com_create(struct sockaddr_in *, rpcprog_t, rpcvers_t,
-     int *, u_int, u_int, char *, int);
- static SVCXPRT *svc_com_create(int, u_int, u_int, char *);
-@@ -147,8 +145,7 @@ clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp, flags)
-       bindaddr.maxlen = bindaddr.len =  sizeof (struct sockaddr_in);
-       bindaddr.buf = raddr;
--      if (__binddynport(fd) == -1)
--              goto err;
-+      bindresvport(fd, NULL);
-       cl = clnt_tli_create(fd, nconf, &bindaddr, prog, vers,
-                               sendsz, recvsz);
-       if (cl) {
-diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
-index a94fc73..e45736a 100644
---- a/src/rpcb_clnt.c
-+++ b/src/rpcb_clnt.c
-@@ -752,7 +752,7 @@ __try_protocol_version_2(program, version, nconf, host, tp)
-       client = getpmaphandle(nconf, host, &parms.r_addr);
-       if (client == NULL)
--              return (NULL);
-+              goto error;
-       /*
-        * Set retry timeout.
-@@ -771,11 +771,11 @@ __try_protocol_version_2(program, version, nconf, host, tp)
-       if (clnt_st != RPC_SUCCESS) {
-               rpc_createerr.cf_stat = RPC_PMAPFAILURE;
-               clnt_geterr(client, &rpc_createerr.cf_error);
--              return (NULL);
-+              goto error;
-       } else if (port == 0) {
-               pmapaddress = NULL;
-               rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED;
--              return (NULL);
-+              goto error;
-       }
-       port = htons(port);
-       CLNT_CONTROL(client, CLGET_SVC_ADDR, (char *)&remote);
-@@ -789,14 +789,24 @@ __try_protocol_version_2(program, version, nconf, host, tp)
-                       free(pmapaddress);
-                       pmapaddress = NULL;
-               }
--              return (NULL);
-+              goto error;
-       }
-       memcpy(pmapaddress->buf, remote.buf, remote.len);
-       memcpy(&((char *)pmapaddress->buf)[sizeof (short)],
-                       (char *)(void *)&port, sizeof (short));
-       pmapaddress->len = pmapaddress->maxlen = remote.len;
-+      CLNT_DESTROY(client);
-       return pmapaddress;
-+
-+error:
-+      if (client) {
-+              CLNT_DESTROY(client);
-+              client = NULL;
-+
-+      }
-+      return (NULL);
-+
- }
- #endif
-@@ -836,6 +846,7 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
-       struct netbuf *address = NULL;
-       rpcvers_t start_vers = RPCBVERS4;
-       struct netbuf servaddr;
-+      struct rpc_err rpcerr;
-       /* parameter checking */
-       if (nconf == NULL) {
-@@ -892,7 +903,8 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
-               clnt_st = CLNT_CALL(client, (rpcproc_t)RPCBPROC_GETADDR,
-                   (xdrproc_t) xdr_rpcb, (char *)(void *)&parms,
-                   (xdrproc_t) xdr_wrapstring, (char *)(void *) &ua, *tp);
--              if (clnt_st == RPC_SUCCESS) {
-+              switch (clnt_st) {
-+              case RPC_SUCCESS:
-                       if ((ua == NULL) || (ua[0] == 0)) {
-                               /* address unknown */
-                               rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED;
-@@ -914,12 +926,15 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
-                           (char *)(void *)&servaddr);
-                       __rpc_fixup_addr(address, &servaddr);
-                       goto done;
--              } else if (clnt_st == RPC_PROGVERSMISMATCH) {
--                      struct rpc_err rpcerr;
-+              case RPC_PROGVERSMISMATCH:
-                       clnt_geterr(client, &rpcerr);
-                       if (rpcerr.re_vers.low > RPCBVERS4)
-                               goto error;  /* a new version, can't handle */
--              } else if (clnt_st != RPC_PROGUNAVAIL) {
-+                      /* Try the next lower version */
-+              case RPC_PROGUNAVAIL:
-+              case RPC_CANTDECODEARGS:
-+                      break;
-+              default:
-                       /* Cant handle this error */
-                       rpc_createerr.cf_stat = clnt_st;
-                       clnt_geterr(client, &rpc_createerr.cf_error);
-@@ -929,7 +944,7 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
- #ifdef PORTMAP        /* Try version 2 for TCP or UDP */
-       if (strcmp(nconf->nc_protofmly, NC_INET) == 0) {
--              address = __try_protocol_version_2(program, 2, nconf, host, tp);
-+              address = __try_protocol_version_2(program, version, nconf, host, tp);
-               if (address == NULL)
-                       goto error;
-       }
-diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c
-index 4410262..846c7bf 100644
---- a/src/xdr_stdio.c
-+++ b/src/xdr_stdio.c
-@@ -38,6 +38,7 @@
-  */
- #include <stdio.h>
-+#include <stdint.h>
- #include <arpa/inet.h>
- #include <rpc/types.h>
-@@ -103,10 +104,12 @@ xdrstdio_getlong(xdrs, lp)
-       XDR *xdrs;
-       long *lp;
- {
-+      int32_t mycopy;
--      if (fread(lp, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
-+      if (fread(&mycopy, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
-               return (FALSE);
--      *lp = (long)ntohl((u_int32_t)*lp);
-+
-+      *lp = (long)ntohl(mycopy);
-       return (TRUE);
- }
-@@ -115,8 +118,14 @@ xdrstdio_putlong(xdrs, lp)
-       XDR *xdrs;
-       const long *lp;
- {
--      long mycopy = (long)htonl((u_int32_t)*lp);
-+      int32_t mycopy;
-+
-+#if defined(_LP64)
-+      if ((*lp > UINT32_MAX) || (*lp < INT32_MIN))
-+              return (FALSE);
-+#endif
-+      mycopy = (int32_t)htonl((int32_t)*lp);
-       if (fwrite(&mycopy, sizeof(int32_t), 1, (FILE *)xdrs->x_private) != 1)
-               return (FALSE);
-       return (TRUE);
index 035b6400a58825c9f1d238b9fdfccc491ab68d20..8dd2cea15f3ac7ea95b0907266d4080057e81727 100644 (file)
@@ -1,22 +1,16 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libupnp
-PKG_VERSION:=1.6.19
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.25
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/pupnp
-PKG_HASH:=b3142b39601243b50532eec90f4a27dba85eb86f58d4b849ac94edeb29d9b22a
+PKG_HASH:=c5a300b86775435c076d58a79cc0d5a977d76027d2a7d721590729b7f369fa43
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
index 063c478b51cae72341738dd579e4434d781b0174..08dc939fa7c61d8e3a7891410a375eab7ac10b08 100644 (file)
@@ -8,19 +8,18 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libuvc
 
-PKG_VERSION=0.0.5-20140812-$(PKG_SOURCE_VERSION)
+PKG_VERSION:=0.0.6
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ktossell/libuvc.git
-PKG_SOURCE_VERSION:=2c6403405872aa865999b95ba15944295adf6c38
-
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=93f33620e00276989211d9c129a6d8b5e0f45df8d23235ff0c53c823c52a5ef5
+PKG_SOURCE_URL:=https://codeload.github.com/ktossell/libuvc/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=42175a53c1c704365fdc782b44233925e40c9344fbb7f942181c1090f06e2873
+
 PKG_LICENSE:=BSD
+PKG_LICENSE_FILES:=LICENSE.txt
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 CMAKE_INSTALL:=1
 
@@ -32,11 +31,11 @@ define Package/libuvc
        CATEGORY:=Libraries
        TITLE:=libuvc
        DEPENDS:=+libusb-1.0 +libjpeg
-       URL:=https://int80k.com/libuvc
+       URL:=https://int80k.com/libuvc
 endef
 
 define Package/libuvc/description
- This package contains libuvc is a cross-platform library for USB video devices, 
+ This package contains libuvc is a cross-platform library for USB video devices,
  built atop libusb.
 endef
 
index d9a4d8c68dcc8aa09472a239cd195e82a554b33a..fb4ded82c895c9b7221da2d9f7f865da2eddce29 100644 (file)
@@ -1,7 +1,4 @@
 #
-# Copyright (C) 2009-2015 OpenWrt.org
-# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v4l-utils
-PKG_VERSION:=1.10.0
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
-PKG_HASH:=78ead27ee58a701d7c6342303cf4520bdd4a2b88a7813bc99a0b389307e4336b
+PKG_SOURCE_URL:=https://www.linuxtv.org/downloads/v4l-utils
+PKG_HASH:=e6b962c4b1253cf852c31da13fd6b5bb7cbe5aa9e182881aec55123bae680692
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
@@ -89,14 +86,14 @@ define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert,2rds}.{a,so*} $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert}.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libv4l{1,2,convert,2rds}.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/libv4l/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert,2rds}.so.* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/libv4l
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l/
 endef
@@ -106,10 +103,11 @@ define Package/v4l-utils/install
        $(CP) $(PKG_INSTALL_DIR)/etc/rc_maps.cfg $(1)/etc/
        $(CP) $(PKG_INSTALL_DIR)/etc/rc_keymaps $(1)/etc/
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{cx18,ivtv}-ctl $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{rds,media,cx18,ivtv}-ctl $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/decode_tm6000 $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-keytable $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ir-{ctl,keytable} $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/v4l2-{compliance,ctl,sysfs-path} $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/cec-{compliance,ctl,follower} $(1)/usr/bin/
 endef
 
 $(eval $(call BuildPackage,libv4l))
index 34e0511ab7c5fa4a1257370722da10670368a63b..0885fe42aa591b4ffc146585197e878e8ce510e4 100644 (file)
@@ -1,3 +1,13 @@
+--- a/utils/v4l2-ctl/v4l2-ctl.cpp
++++ b/utils/v4l2-ctl/v4l2-ctl.cpp
+@@ -46,6 +46,7 @@
+ #include <vector>
+ #include <map>
+ #include <algorithm>
++#include <string_iostream>
+ #include <fstream>
+ char options[OptLast];
 --- a/utils/rds-ctl/rds-ctl.cpp
 +++ b/utils/rds-ctl/rds-ctl.cpp
 @@ -29,6 +29,7 @@
  #include <libv4l2.h>
 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
 +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
-@@ -14,6 +14,7 @@
+@@ -17,6 +17,7 @@
  #include <sys/mman.h>
  #include <dirent.h>
  #include <math.h>
 +#include <time.h>
  
  #include "v4l2-ctl.h"
+ #include "v4l-stream.h"
+--- a/utils/cec-ctl/cec-ctl.cpp
++++ b/utils/cec-ctl/cec-ctl.cpp
+@@ -30,6 +30,7 @@
+ #include <errno.h>
+ #include <sys/ioctl.h>
+ #include <stdarg.h>
++#include <time.h>
+ #include <cerrno>
+ #include <string>
+ #include <vector>
+--- a/utils/cec-compliance/cec-compliance.h
++++ b/utils/cec-compliance/cec-compliance.h
+@@ -21,6 +21,7 @@
+ #define _CEC_COMPLIANCE_H_
  
+ #include <stdarg.h>
++#include <time.h>
+ #include <cerrno>
+ #include <string>
+ #include <linux/cec-funcs.h>
+--- a/utils/cec-follower/cec-follower.h
++++ b/utils/cec-follower/cec-follower.h
+@@ -37,6 +37,7 @@
+ #define _CEC_FOLLOWER_H_
+ #include <stdarg.h>
++#include <time.h>
+ #include <cerrno>
+ #include <string>
+ #include <linux/cec-funcs.h>
diff --git a/libs/libv4l/patches/030-dont-call-getsubopt.patch b/libs/libv4l/patches/030-dont-call-getsubopt.patch
deleted file mode 100644 (file)
index 5824c70..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
-+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
-@@ -671,15 +671,18 @@ static bool parse_subset(char *optarg)
- static bool parse_next_subopt(char **subs, char **value)
- {
--      static char *const subopts[] = {
--          NULL
--      };
--      int opt = getsubopt(subs, subopts, value);
-+      char *stmp = *subs;
-+      *value = NULL;
--      if (opt < 0 || *value)
-+      if (*subs) {
-+              *subs = strchr(stmp, ',');
-+              if (*subs)
-+                      *(*subs)++ = 0;
-+              else *subs = stmp + strlen(stmp);
-+
-+              *value = stmp;
-               return false;
--      fprintf(stderr, "No value given to suboption <%s>\n",
--                      subopts[opt]);
-+      }
-       return true;
- }
index b7025681f14de3708468ee50b1ad04e5e5e8f854..26dc23f54a103ca0e6ef59a71091c8d5f69d65b5 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libwebsockets
-PKG_VERSION:=3.0.0
+PKG_VERSION:=3.0.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a6b611c212c52f161f70556339fdaa199b7e9b6a167c4638e086d19db75d6290
+PKG_HASH:=cb0cdd8d0954fcfd97a689077568f286cdbb44111883e0a85d29860449c47cbf
 
 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 
index 0c128817c03cdb29cd644ac3b50cb361dca2160c..7fc1f03c83e149ca826f708384fa1d3526f94725 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=p11-kit
-PKG_VERSION:=0.23.13
+PKG_VERSION:=0.23.14
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=aa65403e3ac7c3aba17ca60f28db17b9c76d988b66b91789b8e8c145ae9922f1
+PKG_HASH:=1cb9fa6d237539f25f62f4c3d4ec71a1c8e0772957ec45ec5af92134129e0d70
 PKG_SOURCE_URL:=https://github.com/p11-glue/$(PKG_NAME)/releases/download/$(PKG_VERSION)
 
 PKG_BUILD_PARALLEL:=1
index 43131a16a4de11a53b8aab472699d4f9f75a0285..12558de0754d31834828b3930138a1f3998c630d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tdb
 PKG_VERSION:=1.3.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-2.0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/libs/tdb/patches/100-Remove_libbsd_dependency_check.patch b/libs/tdb/patches/100-Remove_libbsd_dependency_check.patch
new file mode 100644 (file)
index 0000000..150d17b
--- /dev/null
@@ -0,0 +1,61 @@
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index fd00a42..337d559 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -340,22 +340,13 @@ def configure(conf):
+     conf.CHECK_FUNCS('prctl dirname basename')
+-    strlcpy_in_bsd = False
+-
+-    # libbsd on some platforms provides strlcpy and strlcat
+-    if not conf.CHECK_FUNCS('strlcpy strlcat'):
+-        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+-                               checklibc=True):
+-            strlcpy_in_bsd = True
+-    if not conf.CHECK_FUNCS('getpeereid'):
+-        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+-        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS('setproctitle_init'):
+-        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+-    if not conf.CHECK_FUNCS('closefrom'):
+-        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++    # Not checking for libbsd
++    conf.CHECK_FUNCS('strlcpy strlcat')
++    conf.CHECK_FUNCS('getpeereid')
++    conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
++    conf.CHECK_FUNCS('setproctitle_init')
++
++    conf.CHECK_FUNCS('closefrom')
+     conf.CHECK_CODE('''
+                 struct ucred cred;
+@@ -698,9 +689,6 @@ def configure(conf):
+     # look for a method of finding the list of network interfaces
+     for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+-        bsd_for_strlcpy = ''
+-        if strlcpy_in_bsd:
+-            bsd_for_strlcpy = ' bsd'
+         if conf.CHECK_CODE('''
+                            #define %s 1
+                            #define NO_CONFIG_H 1
+@@ -713,7 +701,7 @@ def configure(conf):
+                            #include "test/getifaddrs.c"
+                            ''' % method,
+                            method,
+-                           lib='nsl socket' + bsd_for_strlcpy,
++                           lib='nsl socket',
+                            addmain=False,
+                            execute=True):
+             break
+@@ -761,7 +749,6 @@ def build(bld):
+                 break
+     extra_libs = ''
+-    if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
+     bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+         REPLACE_HOSTCC_SOURCE,
index 59d6ee8f1b6fcdd30a755a78892406f6e3715e61..9830c33d1541d9bb941388ba0f6e4e126ff4c3a6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tiff
 PKG_VERSION:=4.0.9
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.osgeo.org/libtiff
diff --git a/libs/tiff/patches/027-CVE-2017-17095.patch b/libs/tiff/patches/027-CVE-2017-17095.patch
new file mode 100644 (file)
index 0000000..04dd635
--- /dev/null
@@ -0,0 +1,40 @@
+From 9171da596c88e6a2dadcab4a3a89dddd6e1b4655 Mon Sep 17 00:00:00 2001
+From: Nathan Baker <elitebadger@gmail.com>
+Date: Thu, 25 Jan 2018 21:28:15 +0000
+Subject: [PATCH] Add workaround to pal2rgb buffer overflow.
+
+---
+ tools/pal2rgb.c | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/tools/pal2rgb.c b/tools/pal2rgb.c
+index 0423598..01fcf94 100644
+--- a/tools/pal2rgb.c
++++ b/tools/pal2rgb.c
+@@ -184,8 +184,21 @@ main(int argc, char* argv[])
+       { unsigned char *ibuf, *obuf;
+         register unsigned char* pp;
+         register uint32 x;
+-        ibuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(in));
+-        obuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(out));
++        tmsize_t tss_in = TIFFScanlineSize(in);
++        tmsize_t tss_out = TIFFScanlineSize(out);
++        if (tss_out / tss_in < 3) {
++              /*
++               * BUG 2750: The following code does not know about chroma
++               * subsampling of JPEG data. It assumes that the output buffer is 3x
++               * the length of the input buffer due to exploding the palette into
++               * RGB tuples. If this assumption is incorrect, it could lead to a
++               * buffer overflow. Go ahead and fail now to prevent that.
++               */
++              fprintf(stderr, "Could not determine correct image size for output. Exiting.\n");
++              return -1;
++      }
++        ibuf = (unsigned char*)_TIFFmalloc(tss_in);
++        obuf = (unsigned char*)_TIFFmalloc(tss_out);
+         switch (config) {
+         case PLANARCONFIG_CONTIG:
+               for (row = 0; row < imagelength; row++) {
+--
+libgit2 0.27.0
+
index 449594b35b19cbc04acb74a81f7f88cea35d48d8..aa3e31e4f2daa45d4c4e94d3f5687f27b8042538 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=clamsmtp
 PKG_VERSION:=1.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://thewalter.net/stef/software/clamsmtp/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/mail/clamsmtp/patches/010-fix-build.patch b/mail/clamsmtp/patches/010-fix-build.patch
new file mode 100644 (file)
index 0000000..a3d88dc
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/common/sock_any.h b/common/sock_any.h
+index 77c3841..1e30974 100644
+--- a/common/sock_any.h
++++ b/common/sock_any.h
+@@ -39,7 +39,6 @@
+ #ifndef __SOCK_ANY_H__
+ #define __SOCK_ANY_H__
+-#include <sys/socket.h>
+ #include <sys/un.h>
+ #include <netinet/in.h>
index 8875b5ad290302af301eb8c1d8c6cfec67a42afb..3f3796bb454e824a68c82ff58712d437bb5b0abd 100644 (file)
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -8,14 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mailman
+PKG_VERSION:=2.1.29
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_VERSION:=2.1.23
-PKG_HASH:=b022ca6f8534621c9dbe50c983948688bc4623214773b580c2c78e4a7ae43e69
+
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_HASH:=838872713601e8a124146e550f53709482c1ef168f1e16d201465c651cbf0d2c
+
 PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=gnu-COPYING-GPL
+PKG_CPE_ID:=cpe:2.3:a:gnu:mailman
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -23,7 +26,7 @@ define Package/mailman
   SECTION:=mail
   CATEGORY:=Mail
   TITLE:=The GNU Mailing List Manager
-  URL:=http://www.gnu.org/software/mailman/
+  URL:=https://www.gnu.org/software/mailman/
   DEPENDS:=+postfix +python +uhttpd +python-dns
 endef
 
index 5bbf5b27ed728f9451dd2730de0e04bd27923c21..318991148db8337684aec81f8c5919e3f27e29e8 100644 (file)
@@ -1,7 +1,6 @@
-diff -rupN mailman-2.1.14-1/Mailman/Defaults.py.in mailman-2.1.14-1_patched/Mailman/Defaults.py.in
---- mailman-2.1.14-1/Mailman/Defaults.py.in    2011-03-01 23:35:57.000000000 +0300
-+++ mailman-2.1.14-1_patched/Mailman/Defaults.py.in    2011-03-09 12:26:10.000000000 +0300
-@@ -489,7 +489,7 @@ DELIVERY_MODULE = 'SMTPDirect'
+--- a/Mailman/Defaults.py.in
++++ b/Mailman/Defaults.py.in
+@@ -506,7 +506,7 @@ SMTPLIB_DEBUG_LEVEL = 0
  # standard out (or send an email to the site list owner) for manual twiddling
  # of an /etc/aliases style file.  Use 'Postfix' if you are using the Postfix
  # MTA -- but then also see POSTFIX_STYLE_VIRTUAL_DOMAINS.
index e32110665b7d031d3df6da96407856579612d8ca..abadeb8c042bf01cebf670e5967b20b8447a25be 100644 (file)
@@ -1,7 +1,6 @@
-diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure
---- mailman-2.1.18-1/configure 2014-10-26 12:00:38.090360119 +0300
-+++ mailman-2.1.18-1_patched/configure 2014-10-26 12:00:21.323016430 +0300
-@@ -2236,35 +2236,35 @@
+--- a/configure
++++ b/configure
+@@ -2255,35 +2255,35 @@ fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version" >&5
  $as_echo "$version" >&6; }
  
index 1dd2859f2ebac1b94768f45f331c7c4e4b30fe67..49957c05d6e8fdf526d16007ac9a14d3c74f31d6 100644 (file)
@@ -1,7 +1,6 @@
-diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure
---- mailman-2.1.18-1/configure 2014-05-06 20:43:56.000000000 +0400
-+++ mailman-2.1.18-1_patched/configure 2014-11-04 15:02:32.892666331 +0300
-@@ -3927,6 +3927,8 @@
+--- a/configure
++++ b/configure
+@@ -3957,6 +3957,8 @@ fi
  $as_echo "$URLHOST" >&6; }
  rm -f conftest.out conftest.py
  
index 9fa72a26e003f222ffc714e5ddbe38dfd0312f6c..63cc8f9daed22180b5e22550283875d05f0842dd 100644 (file)
@@ -1,7 +1,6 @@
-diff -Naur mailman-2.1.18-1/Mailman/MailList.py mailman-2.1.18-1_patched/Mailman/MailList.py
---- mailman-2.1.18-1/Mailman/MailList.py       2014-05-06 20:43:56.000000000 +0400
-+++ mailman-2.1.18-1_patched/Mailman/MailList.py       2014-11-04 15:57:06.832636147 +0300
-@@ -30,7 +30,7 @@
+--- a/Mailman/MailList.py
++++ b/Mailman/MailList.py
+@@ -30,7 +30,7 @@ import re
  import shutil
  import socket
  import urllib
@@ -10,10 +9,9 @@ diff -Naur mailman-2.1.18-1/Mailman/MailList.py mailman-2.1.18-1_patched/Mailman
  
  from cStringIO import StringIO
  from UserDict import UserDict
-diff -Naur mailman-2.1.18-1/misc/paths.py.in mailman-2.1.18-1_patched/misc/paths.py.in
---- mailman-2.1.18-1/misc/paths.py.in  2014-05-06 20:43:56.000000000 +0400
-+++ mailman-2.1.18-1_patched/misc/paths.py.in  2014-11-04 15:55:49.594941540 +0300
-@@ -66,14 +66,14 @@
+--- a/misc/paths.py.in
++++ b/misc/paths.py.in
+@@ -71,14 +71,14 @@ sys.path.append(distdir)
  # In a normal interactive Python environment, the japanese.pth and korean.pth
  # files would be imported automatically.  But because we inhibit the importing
  # of the site module, we need to be explicit about importing these codecs.
index 206af81b372a6b930111ee8818e0216d32998968..ecfbd8915c7c38c17990773313cebd81e64ff52b 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mutt
-PKG_VERSION:=1.10.0
+PKG_VERSION:=1.10.1
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=ftp://ftp.mutt.org/pub/mutt/ \
                https://bitbucket.org/mutt/mutt/downloads/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=0215b5f90ef9cc33441a6ca842379b64412ed7f8da83ed68bfaa319179f5535b
+PKG_HASH:=734a3883158ec3d180cf6538d8bd7f685ce641d2cdef657aa0038f76e79a54a0
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=GPL
index f8a96e06e9ae8080291529a97aa0817516f37bf2..e8a7c2620cd5f9a44a24cc4dad0325879c311fcd 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postfix
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_VERSION:=3.3.1
 PKG_SOURCE_URL:= \
        https://cdn.postfix.johnriley.me/mirrors/postfix-release/official/ \
@@ -27,6 +27,7 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_POSTFIX_CDB \
        CONFIG_POSTFIX_DB \
        CONFIG_POSTFIX_SQLITE \
+       CONFIG_POSTFIX_MYSQL \
        CONFIG_POSTFIX_PGSQL \
        CONFIG_POSTFIX_PCRE \
        CONFIG_POSTFIX_EAI \
@@ -41,7 +42,7 @@ define Package/postfix
        postfix=25:postfix=25 \
        postdrop=26:postdrop=26
   URL:=http://www.postfix.org/
-  DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_SQLITE:libsqlite3 +POSTFIX_PGSQL:libpq +POSTFIX_EAI:icu +POSTFIX_PCRE:libpcre
+  DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +POSTFIX_SQLITE:libsqlite3 +POSTFIX_MYSQL:libmysqlclient +POSTFIX_PGSQL:libpq +POSTFIX_EAI:icu +POSTFIX_PCRE:libpcre
 endef
 
 define Package/postfix/description
@@ -80,6 +81,11 @@ define Package/postfix/config
                        default y
                        help
                          Implements support for SQLite3 DB
+               config POSTFIX_MYSQL
+                       bool "MYSQL support"
+                       default n
+                       help
+                         Implements support for MySQL
                config POSTFIX_PGSQL
                        bool "PostgreSQL support"
                        default n
@@ -144,6 +150,11 @@ ifdef CONFIG_POSTFIX_SQLITE
   AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lsqlite3 -lpthread
 endif
 
+ifdef CONFIG_POSTFIX_MYSQL
+  CCARGS+=-DHAS_MYSQL -I$(STAGING_DIR)/usr/include/mysql
+  AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lmysqlclient -lz -lm
+endif
+
 ifdef CONFIG_POSTFIX_PGSQL
   CCARGS+=-DHAS_PGSQL -I$(STAGING_DIR)/usr/include/
   AUXLIBS+=-L$(STAGING_DIR)/usr/lib -lpq
index e33c3cfab8cbf52cc3d64a39968da8939b5e6a3a..27b79aae3edec2c940bd1c0520e4b9e5682020f6 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2014 OpenWrt.org
 
-START=50
+START=72
 STOP=50
 EXTRA_COMMANDS="status abort flush postinst"
 EXTRA_HELP="   status  Display the service status
index 390012a654363e6a0978aca33a2436986398a3fe..f627db8f94e59615f254f58ce7b26b61e9864cbe 100644 (file)
@@ -656,11 +656,13 @@ define Build/InstallDev/full
        $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
+ifneq ($(CONFIG_SOFT_FLOAT),y)
 ifneq ($(CONFIG_PACKAGE_libx264),)
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
 endif
+endif
 endef
 
 define Build/InstallDev/mini
@@ -722,9 +724,11 @@ endef
 define Package/libffmpeg-full/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
+ifneq ($(CONFIG_SOFT_FLOAT),y)
 ifneq ($(CONFIG_PACKAGE_libx264),)
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
 endif
+endif
 endef
 
 define Package/libffmpeg-mini/install
index 4c2822a6042211fe75066b0a5d751e6efed698cc..f6e5069ae8cded9e33745842914a951d755aecca 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-libav
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -16,7 +16,7 @@ PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
 
 PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
-PKG_HASH:=eff80a02d2f2fb9f34b67e9a26e9954d3218c7aa18e863f2a47805fa7066029d
+PKG_HASH:=8a351c39c5cfc2bbd31ca434ec4a290a730a26efbdea962fdd8306dce5c576de
 
 PKG_LICENSE:=GPL-2.0 LGPL-2.0
 PKG_LICENSE_FILES:=COPYING COPYING.LIB
index 3e0f7cfcba4a139f4a6e733b76d13a961f6bfb73..70b16e4fb30b58b53b2571c4bf9ce4289ee3a503 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-bad
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING.LIB COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
-PKG_HASH:=2a77c6908032aafdf2cd2e5823fec948f16a25c2d1497a953828d762dc20d61a
+PKG_HASH:=34fab7da70994465a64468330b2168a4a0ed90a7de7e4c499b6d127c6c1b1eaf
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index 7c445995de9707dcf6e717cb1a82a98843c571d1..b251be39bbf624f714efb1c7e85f717cca426ee9 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-base
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING.LIB COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
-PKG_HASH:=1026c7c3082d825d9b5d034c1a6dd8a4ebab60eb3738b0a0afde4ad2dc0b0db5
+PKG_HASH:=a4b7e80ba869f599307449b17c9e00b5d1e94d3ba1d8a1a386b8770b2ef01c7c
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_gst1-mod-alsa \
index 3f01575face97ec7a7029dab70214ebc053f483e..c9b87be501d38f8b480deb51e5061a7fc10ac41c 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-good
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
-PKG_HASH:=34ec062ddb766a32377532e039781f4a16fbc3e8b449e642605bacab26a99172
+PKG_HASH:=c0575e2811860bfff59b865b8d125153859a01f0615fa41e279b64d88d25caad
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_gst1-mod-lame \
index bc89f92e876e31fc8c0c5fe682eb370c9ff4bccd..b42103e21575d881c66c687e9baf2d33b17620b9 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gst1-plugins-ugly
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
 PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
-PKG_HASH:=cff2430bb13f54ef81409a0b3d65ce409a376d4a7bab57a14a97d602539fe1d3
+PKG_HASH:=55e097d9d93921fdcf7abb0ff92d23b21dd9098e632f1ba433603b3bd1cf3d69
 
 PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_gst1-mod-asf \
index 61fc98a6f7f8ce0a1f25fe4cdb03cd7e6da248eb..2abe86483f2b9fe291d25ab621636bf419f09a38 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gstreamer1
-PKG_VERSION:=1.14.1
+PKG_VERSION:=1.14.2
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
 PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
-PKG_HASH:=28d82b0d261544a9bf85b429399929e4986eb00efcf1ce16cc71d269a4c3186c
+PKG_HASH:=4bd6127299f3f29379046bbd58a526e6353b569e0e72f7b4df2ae70df6882e09
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
index 1f0fca7b8a643825d30dcbe888760bbfc05035ca..8b3ca6fd47309ef3a2b787ffe94613c8eb7fee1d 100644 (file)
@@ -8,22 +8,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=motion
-PKG_VERSION=3.4.0-20141018-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=3
+PKG_VERSION:=4.1.1
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/Mr-Dave/motion.git
-PKG_SOURCE_VERSION:=9479d910f2149b5558788bb86f97f26522794212
+PKG_SOURCE:=$(PKG_NAME)-release-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/Motion-Project/motion/tar.gz/release-$(PKG_VERSION)?
+PKG_HASH:=2074b935bdfe28f84c2c3233274b06908336778f303bb13530d4299c3f8aa4e2
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
 
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
-PKG_MIRROR_HASH:=02602c775ec3829dac59aed16ea6b0d78f77a435b9c360db1a05cb27227da97e
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -32,7 +30,7 @@ define Package/motion
   CATEGORY:=Multimedia
   DEPENDS:=+libjpeg +libpthread
   TITLE:=webcam motion sensing and logging
-  URL:=http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
+  URL:=https://motion-project.github.io/
 endef
 
 define Package/motion/conffiles
diff --git a/multimedia/motion/patches/010-Initialize-the-thread-at-start-of-main.patch b/multimedia/motion/patches/010-Initialize-the-thread-at-start-of-main.patch
new file mode 100644 (file)
index 0000000..5e8eafa
--- /dev/null
@@ -0,0 +1,94 @@
+From 3c7cbd685017c1bf9ba2eaa811b63842bec28f64 Mon Sep 17 00:00:00 2001
+From: Mr-DaveDev <MotionMrDaveDev@gmail.com>
+Date: Mon, 1 Jan 2018 13:07:08 -0700
+Subject: [PATCH] Initialize the thread at start of main
+
+Closes #589
+---
+ logger.c |  5 -----
+ motion.c | 30 ++++++++++++++++--------------
+ 2 files changed, 16 insertions(+), 19 deletions(-)
+
+diff --git a/logger.c b/logger.c
+index c55044b..5ef2f85 100644
+--- a/logger.c
++++ b/logger.c
+@@ -193,11 +193,6 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, .
+     //printf("log_type %d, type %d level %d\n", log_type, type, level);
+-    /*
+-     * If pthread_getspecific fails (e.g., because the thread's TLS doesn't
+-     * contain anything for thread number, it returns NULL which casts to zero,
+-     * which is nice because that's what we want in that case.
+-     */
+     threadnr = (unsigned long)pthread_getspecific(tls_key_threadnr);
+     /*
+diff --git a/motion.c b/motion.c
+index 985d4b2..9fe58c1 100644
+--- a/motion.c
++++ b/motion.c
+@@ -2886,10 +2886,6 @@ static void motion_startup(int daemonize, int argc, char *argv[])
+     }
+-    //set_log_level(cnt_list[0]->log_level);
+-
+-    MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Motion "VERSION" Started");
+-
+     if ((cnt_list[0]->conf.log_file) && (strncmp(cnt_list[0]->conf.log_file, "syslog", 6))) {
+         set_log_mode(LOGMODE_FILE);
+         ptr_logfile = set_logfile(cnt_list[0]->conf.log_file);
+@@ -2908,6 +2904,8 @@ static void motion_startup(int daemonize, int argc, char *argv[])
+         MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Logging to syslog");
+     }
++    MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Motion "VERSION" Started");
++
+     if ((cnt_list[0]->conf.log_type_str == NULL) ||
+         !(cnt_list[0]->log_type = get_log_type(cnt_list[0]->conf.log_type_str))) {
+         cnt_list[0]->log_type = TYPE_DEFAULT;
+@@ -3053,8 +3051,22 @@ int main (int argc, char **argv)
+      */
+     struct sigaction sig_handler_action;
+     struct sigaction sigchild_action;
++
++
+     setup_signals(&sig_handler_action, &sigchild_action);
++    /*
++     * Create and a thread attribute for the threads we spawn later on.
++     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
++     * their termination cannot be synchronized through 'pthread_join'.
++     */
++    pthread_attr_init(&thread_attr);
++    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
++
++    /* Create the TLS key for thread number. */
++    pthread_key_create(&tls_key_threadnr, NULL);
++    pthread_setspecific(tls_key_threadnr, (void *)(0));
++
+     motion_startup(1, argc, argv);
+     ffmpeg_global_init();
+@@ -3102,16 +3114,6 @@ int main (int argc, char **argv)
+     if (cnt_list[0]->conf.setup_mode)
+         MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "Motion running in setup mode.");
+-    /*
+-     * Create and a thread attribute for the threads we spawn later on.
+-     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
+-     * their termination cannot be synchronized through 'pthread_join'.
+-     */
+-    pthread_attr_init(&thread_attr);
+-    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
+-
+-    /* Create the TLS key for thread number. */
+-    pthread_key_create(&tls_key_threadnr, NULL);
+     do {
+         if (restart) {
+-- 
+2.7.4
+
diff --git a/multimedia/motion/patches/100-musl-compat.patch b/multimedia/motion/patches/100-musl-compat.patch
deleted file mode 100644 (file)
index b788e26..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
---- a/motion.c
-+++ b/motion.c
-@@ -2630,6 +2630,17 @@ int main (int argc, char **argv)
-     struct sigaction sigchild_action;
-     setup_signals(&sig_handler_action, &sigchild_action);
-+    /*
-+     * Create and a thread attribute for the threads we spawn later on.
-+     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
-+     * their termination cannot be synchronized through 'pthread_join'.
-+     */
-+    pthread_attr_init(&thread_attr);
-+    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
-+
-+    /* Create the TLS key for thread number. */
-+    pthread_key_create(&tls_key_threadnr, NULL);
-+
-     motion_startup(1, argc, argv);
- #ifdef HAVE_FFMPEG
-@@ -2648,17 +2659,6 @@ int main (int argc, char **argv)
-     if (cnt_list[0]->conf.setup_mode)
-         MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "%s: Motion running in setup mode.");
--    /*
--     * Create and a thread attribute for the threads we spawn later on.
--     * PTHREAD_CREATE_DETACHED means to create threads detached, i.e.
--     * their termination cannot be synchronized through 'pthread_join'.
--     */
--    pthread_attr_init(&thread_attr);
--    pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
--
--    /* Create the TLS key for thread number. */
--    pthread_key_create(&tls_key_threadnr, NULL);
--
-     do {
-         if (restart) {
-             /*
---- a/motion.h
-+++ b/motion.h
-@@ -84,7 +84,7 @@
- #endif
- /* strerror_r() XSI vs GNU */
--#if (defined(BSD)) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
-+#if (defined(BSD)) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE) || (!defined(__GLIBC__))
- #define XSI_STRERROR_R
- #endif
index f787f54ebecbfcc4c097abda0c86700c18930b11..7bf98cc06147c0b52b1045e8e561966fc97fca8e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.7.9
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 PKG_LICENSE:=GPLv3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -75,7 +75,7 @@ define Package/luci-app-acme
   SECTION:=luci
   CATEGORY:=LuCI
   TITLE:=ACME package - LuCI interface
-  DEPENDS:= lua luci-base +acme luci-app-uhttpd
+  DEPENDS:= lua luci-base +acme
   SUBMENU:=3. Applications
 endef
 
index 193699cc398ac3e475118cb8155a8c1d5ddfccf9..2b97272172591f33848ec723dc22e1cdea600d16 100644 (file)
@@ -10,6 +10,12 @@ Copyright 2016 Toke Høiland-Jørgensen <toke@toke.dk>
 
 ]]--
 
+local ipkg = require "luci.model.ipkg"
+
+local nginx_presence = ipkg.installed("nginx-all-module") or ipkg.installed("nginx-ssl") or false
+
+local uhttpd_presence = ipkg.installed("uhttpd") or false
+
 m = Map("acme", translate("ACME certificates"),
        translate("This configures ACME (Letsencrypt) automatic certificate installation. " ..
                   "Simply fill out this to have the router configured with Letsencrypt-issued " ..
@@ -52,10 +58,22 @@ kl = cs:option(Value, "keylength", translate("Key length"),
 kl.rmempty = false
 kl.datatype = "and(uinteger,min(2048))"
 
+if uhttpd_presence then
 u = cs:option(Flag, "update_uhttpd", translate("Use for uhttpd"),
               translate("Update the uhttpd config with this certificate once issued " ..
-                        "(only select this for one certificate)."))
+                        "(only select this for one certificate)." ..
+                        "Is also available luci-app-uhttpd to configure uhttpd form the LuCI interface."))
+u.rmempty = false
+end
+
+if nginx_presence then
+u = cs:option(Flag, "update_nginx", translate("Use for nginx"),
+              translate("Update the nginx config with this certificate once issued " ..
+                        "(only select this for one certificate)." ..
+                        "Nginx must support ssl, if not it won't start as it needs to be " ..
+                        "compiled with ssl support to use cert options"))
 u.rmempty = false
+end
 
 wr = cs:option(Value, "webroot", translate("Webroot directory"),
                translate("Webserver root directory. Set this to the webserver " ..
index af12ce1fb008e2f2f2f37e4dd1ae389569e7f3ab..95565c83281fbea0b037dd65206904d592e8f534 100644 (file)
@@ -8,5 +8,6 @@ config cert 'example'
        option use_staging 1
        option keylength 2048
        option update_uhttpd 1
+       option update_nginx 1
        option webroot ""
        list domains example.org
index 25c36028a81138950332b811e1a7305f487a93a2..233abee68667cca2bbbb3355ae665844d1cf60d5 100644 (file)
@@ -17,6 +17,9 @@ UHTTPD_LISTEN_HTTP=
 STATE_DIR='/etc/acme'
 ACCOUNT_EMAIL=
 DEBUG=0
+NGINX_WEBSERVER=0
+UPDATE_NGINX=0
+UPDATE_UHTTPD=0
 
 . /lib/functions.sh
 
@@ -42,9 +45,13 @@ debug()
     [ "$DEBUG" -eq "1" ] && logger -t acme -s -p daemon.debug "$@"
 }
 
-get_listeners()
-{
-    netstat -nptl 2>/dev/null | awk 'match($4, /:80$/){split($7, parts, "/"); print parts[2];}' | uniq | tr "\n" " "
+get_listeners() {
+    local proto rq sq listen remote state program
+    netstat -nptl 2>/dev/null | while read proto rq sq listen remote state program; do
+        case "$proto#$listen#$program" in
+            tcp#*:80#[0-9]*/*) echo -n "${program%% *} " ;;
+        esac
+    done
 }
 
 pre_checks()
@@ -54,37 +61,58 @@ pre_checks()
     log "Running pre checks for $main_domain."
 
     listeners="$(get_listeners)"
-    debug "port80 listens: $listeners"
-
-    case "$listeners" in
-        "uhttpd")
-            debug "Found uhttpd listening on port 80; trying to disable."
 
-            UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
-
-            if [ -z "$UHTTPD_LISTEN_HTTP" ]; then
-                err "$main_domain: Unable to find uhttpd listen config."
-                err "Manually disable uhttpd or set webroot to continue."
-                return 1
-            fi
+    debug "port80 listens: $listeners"
 
-            uci set uhttpd.main.listen_http=''
-            uci commit uhttpd || return 1
-            if ! /etc/init.d/uhttpd reload ; then
-                uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
-                uci commit uhttpd
-                return 1
-            fi
+    for listener in $(get_listeners); do
+        pid="${listener%/*}"
+        cmd="${listener#*/}"
+
+        case "$cmd" in
+            uhttpd)
+                debug "Found uhttpd listening on port 80; trying to disable."
+
+                UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
+
+                if [ -z "$UHTTPD_LISTEN_HTTP" ]; then
+                    err "$main_domain: Unable to find uhttpd listen config."
+                    err "Manually disable uhttpd or set webroot to continue."
+                    return 1
+                fi
+
+                uci set uhttpd.main.listen_http=''
+                uci commit uhttpd || return 1
+                if ! /etc/init.d/uhttpd reload ; then
+                    uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
+                    uci commit uhttpd
+                    return 1
+                fi
             ;;
-        "")
-            debug "Nothing listening on port 80."
+            nginx*)
+                debug "Found nginx listening on port 80; trying to disable."
+                NGINX_WEBSERVER=1
+                local tries=0
+                while grep -sq "$cmd" "/proc/$pid/cmdline" && kill -0 "$pid"; do
+                /etc/init.d/nginx stop
+                    if [ $tries -gt 10 ]; then
+                        debug "Can't stop nginx. Terminating script."
+                        return 1
+                    fi
+                    debug "Waiting for nginx to stop..."
+                    tries=$((tries + 1))
+                    sleep 1
+                done
             ;;
-        *)
-            err "$main_domain: Cannot run in standalone mode; another daemon is listening on port 80."
-            err "Disable other daemon or set webroot to continue."
-            return 1
+            "")
+                debug "Nothing listening on port 80."
             ;;
-    esac
+            *)
+                err "$main_domain: Cannot run in standalone mode; another daemon is listening on port 80."
+                err "Disable other daemon or set webroot to continue."
+                return 1
+            ;;
+        esac
+    done
 
     iptables -I input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" || return 1
     ip6tables -I input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" || return 1
@@ -101,11 +129,18 @@ post_checks()
     iptables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
     ip6tables -D input_rule -p tcp --dport 80 -j ACCEPT -m comment --comment "ACME" 2>/dev/null
 
-    if [ -e /etc/init.d/uhttpd ] && [ -n "$UHTTPD_LISTEN_HTTP" ]; then
-        uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
-        uci commit uhttpd
+    if [ -e /etc/init.d/uhttpd ] && ( [ -n "$UHTTPD_LISTEN_HTTP" ] || [ $UPDATE_UHTTPD -eq 1 ] ); then
+        if [ -n "$UHTTPD_LISTEN_HTTP" ]; then
+            uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
+            uci commit uhttpd
+            UHTTPD_LISTEN_HTTP=
+        fi
         /etc/init.d/uhttpd reload
-        UHTTPD_LISTEN_HTTP=
+    fi
+
+    if [ -e /etc/init.d/nginx ] && ( [ "$NGINX_WEBSERVER" -eq 1 ] || [ $UPDATE_NGINX -eq 1 ] ); then
+        NGINX_WEBSERVER=0
+        /etc/init.d/nginx restart
     fi
 }
 
@@ -137,6 +172,7 @@ issue_cert()
     local enabled
     local use_staging
     local update_uhttpd
+    local update_nginx
     local keylength
     local domains
     local main_domain
@@ -148,11 +184,15 @@ issue_cert()
     config_get_bool enabled "$section" enabled 0
     config_get_bool use_staging "$section" use_staging
     config_get_bool update_uhttpd "$section" update_uhttpd
+    config_get_bool update_nginx "$section" update_nginx
     config_get domains "$section" domains
     config_get keylength "$section" keylength
     config_get webroot "$section" webroot
     config_get dns "$section" dns
 
+    UPDATE_NGINX=$update_nginx
+    UPDATE_UHTTPD=$update_uhttpd
+
     [ "$enabled" -eq "1" ] || return
 
     [ "$DEBUG" -eq "1" ] && acme_args="$acme_args --debug"
@@ -215,12 +255,18 @@ issue_cert()
         return 1
     fi
 
-    if [ "$update_uhttpd" -eq "1" ]; then
+    if [ -e /etc/init.d/uhttpd ] && [ "$update_uhttpd" -eq "1" ]; then
         uci set uhttpd.main.key="$STATE_DIR/${main_domain}/${main_domain}.key"
         uci set uhttpd.main.cert="$STATE_DIR/${main_domain}/fullchain.cer"
         # commit and reload is in post_checks
     fi
 
+    if [ -e /etc/init.d/nginx ] && [ "$update_nginx" -eq "1" ]; then
+        sed -i "s#ssl_certificate\ .*#ssl_certificate $STATE_DIR/${main_domain}/fullchain.cer;#g" /etc/nginx/nginx.conf
+        sed -i "s#ssl_certificate_key\ .*#ssl_certificate_key $STATE_DIR/${main_domain}/${main_domain}.key;#g" /etc/nginx/nginx.conf
+        # commit and reload is in post_checks
+    fi
+
     post_checks
 }
 
index 4b199597ea8062a22eacbd5701f604dd2dfedaf1..88b6e5d752fd60d8249efcc7a41dec15a8b9138f 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=3.5.4
+PKG_VERSION:=3.5.5
 PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 8e146ee5b762992c91b15452c6f0ceb0a495a903..fb7856624d78f13f31db272fb6af892ed18b5184 100644 (file)
@@ -61,6 +61,8 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * => infrequent updates, approx. 15.000 entries
     * [winspy](https://github.com/crazy-max/WindowsSpyBlocker)
     * => infrequent updates, approx. 120 entries
+    * [youtube](https://api.hackertarget.com/hostsearch/?q=googlevideo.com)
+    * => dynamic request API to filter "random" youtube ad domains (experimental!), approx. 150 entries
     * [yoyo](http://pgl.yoyo.org/adservers)
     * => weekly updates, approx. 2.500 entries (enabled by default)
     * [zeus tracker](https://zeustracker.abuse.ch)
@@ -96,7 +98,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
 * optional: add new adblock sources on your own, see example below
 
 ## Prerequisites
-* [OpenWrt](https://openwrt.org), tested with the stable release series (17.01.x) and with the latest OpenWrt snapshot
+* [OpenWrt](https://openwrt.org), tested with the stable release series (18.06) and with the latest snapshot
 * a usual setup with an enabled dns backend at minimum - dump AP modes without a working dns backend are _not_ supported
 * a download utility:
     * to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
@@ -109,7 +111,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
 * control the adblock service manually with _/etc/init.d/adblock_ start/stop/restart/reload/suspend/resume/status or use the LuCI frontend
 
 ## LuCI adblock companion package
-* for easy management of the various blocklist sources and all other adblock options you should use the provided LuCI frontend
+* for easy management of the various blocklist sources and adblock runtime options you should use the provided LuCI frontend
 * install 'luci-app-adblock' (_opkg install luci-app-adblock_)
 * the application is located in LuCI under 'Services' menu
 
@@ -143,7 +145,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
     * adb\_forcedns => force dns requests to local resolver (bool/default: '0', disabled)
     * adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (bool/default: '0', disabled)
     * adb\_backup_mode => do not automatically update blocklists during startup, use backups instead (bool/default: '0', disabled)
-    * adb\maxqueue => size of the download queue to handle downloads & list processing in parallel (int/default: '4')
+    * adb\_maxqueue => size of the download queue to handle downloads & list processing in parallel (int/default: '4')
     * adb\_jail => builds an additional 'Jail' list (/tmp/adb_list.jail) to block access to all domains except those listed in the whitelist file (bool/default: '0', disabled)
     * adb\_dnsflush => flush DNS cache after adblock processing, i.e. enable the old restart behavior (bool/default: '0', disabled)
     * adb\_notify => send notification emails in case of a processing error or if the overall domain count is &le; 0 (bool/default: '0', disabled)
@@ -216,12 +218,12 @@ Finally make this file executable via 'chmod' and test it directly. If no more e
 /etc/init.d/adblock status
 ::: adblock runtime information
   + adblock_status  : enabled
-  + adblock_version : 3.5.0
-  + overall_domains : 102324 (normal mode)
-  + fetch_utility   : /usr/bin/wget (built-in)
-  + dns_backend     : kresd (/etc/kresd)
-  + last_rundate    : 30.01.2018 21:24:11
-  + system_release  : Turris Omnia, OpenWrt omnia 15.05/3.9.4
+  + adblock_version : 3.5.5
+  + overall_domains : 97199 (backup mode)
+  + fetch_utility   : /bin/uclient-fetch (libustream-ssl)
+  + dns_backend     : unbound (/var/lib/unbound)
+  + last_rundate    : 01.09.2018 07:09:16
+  + system_release  : PC Engines APU, OpenWrt SNAPSHOT r7986-dc9388ac55
 </code></pre>
   
 **cronjob for a regular block list update (/etc/crontabs/root):**
index a10d158a91b80acb291a949d038fd1fed857a296..c68b82cb6f235734776992059aded3dc753f289d 100644 (file)
@@ -16,127 +16,127 @@ config adblock 'extra'
 
 config source 'adaway'
        option adb_src 'https://adaway.org/hosts.txt'
-       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'focus on mobile ads, infrequent updates, approx. 400 entries'
        option enabled '1'
 
 config source 'adguard'
        option adb_src 'https://filters.adtidy.org/windows/filters/15.txt'
-       option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([\/\^\r]|$)/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[/|^|\r]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+([\/\^\r]|$)/{print tolower(\$3)}'
        option adb_src_desc 'combined adguard dns filter list, frequent updates, approx. 17.000 entries'
        option enabled '0'
 
 config source 'bitcoin'
        option adb_src 'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'
-       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'focus on malicious bitcoin mining sites, infrequent updates, approx. 80 entries'
        option enabled '0'
 
 config source 'blacklist'
        option adb_src '/etc/adblock/adblock.blacklist'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'static local domain blacklist, always deny these domains'
        option enabled '1'
 
 config source 'disconnect'
        option adb_src 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 4.700 entries'
        option enabled '1'
 
 config source 'dshield'
        option adb_src 'https://www.dshield.org/feeds/suspiciousdomains_Low.txt'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'generic blocklist, daily updates, approx. 3.500 entries'
        option enabled '0'
 
 config source 'feodo'
        option adb_src 'https://feodotracker.abuse.ch/blocklist/?download=domainblocklist'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on feodo botnet, daily updates, approx. 0-10 entries'
        option enabled '0'
 
 config source 'hphosts'
        option adb_src 'https://hosts-file.net/ad_servers.txt'
-       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|\$)+/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|\$)+/{print tolower(\$2)}'
        option adb_src_desc 'broad blocklist, monthly updates, approx. 19.200 entries'
        option enabled '0'
 
 config source 'malware'
        option adb_src 'https://mirror.espoch.edu.ec/malwaredomains/justdomains'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'broad blocklist, daily updates, approx. 18.300 entries'
        option enabled '0'
 
 config source 'malwarelist'
        option adb_src 'http://www.malwaredomainlist.com/hostslist/hosts.txt'
-       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'focus on malware, daily updates, approx. 1.200 entries'
        option enabled '0'
 
 config source 'openphish'
        option adb_src 'https://openphish.com/feed.txt'
-       option adb_src_rset 'BEGIN{FS=\"/\"}/^http[s]?:\/\/([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+(\/|$)/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"/\"}/^http[s]?:\/\/([[:alnum:]_-]+\.)+[[:alpha:]]+(\/|$)/{print tolower(\$3)}'
        option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 2.400 entries'
        option enabled '0'
 
 config source 'ransomware'
        option adb_src 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on ransomware by abuse.ch, numerous updates on the same day, approx. 1900 entries'
        option enabled '0'
 
 config source 'reg_cn'
        option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on chinese ads plus generic easylist additions, daily updates, approx. 11.700 entries'
        option enabled '0'
 
 config source 'reg_cz'
        option adb_src 'https://raw.githubusercontent.com/qxstyles/turris-hole-czech-block-list/master/turris-hole-czech-block-list'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on czech ads maintained by Turris Omnia Users, infrequent updates, approx. 100 entries'
        option enabled '0'
 
 config source 'reg_de'
        option adb_src 'https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on german ads plus generic easylist additions, daily updates, approx. 9.200 entries'
        option enabled '0'
 
 config source 'reg_id'
        option adb_src 'https://easylist-downloads.adblockplus.org/abpindo+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on indonesian ads plus generic easylist additions, weekly updates, approx. 9.600 entries'
        option enabled '0'
 
 config source 'reg_nl'
        option adb_src 'https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on dutch ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
        option enabled '0'
 
 config source 'reg_pl'
        option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on polish ads, daily updates, approx. 90 entries'
        option enabled '0'
 
 config source 'reg_ro'
        option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 9.400 entries'
        option enabled '0'
 
 config source 'reg_ru'
        option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
-       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
+       option adb_src_rset 'BEGIN{FS=\"[|^]\"}/^\|\|([[:alnum:]_-]+\.)+[[:alpha:]]+\^("\\\$third-party")?$/{print tolower(\$3)}'
        option adb_src_desc 'focus on russian ads plus generic easylist additions, weekly updates, approx. 14.500 entries'
        option enabled '0'
 
 config source 'shalla'
        option adb_src 'http://www.shallalist.de/Downloads/shallalist.tar.gz'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'huge blocklist archive subdivided in different categories, daily updates. Check http://www.shallalist.de/categories.html for more categories'
        list adb_src_cat 'adv'
        list adb_src_cat 'costtraps'
@@ -147,26 +147,27 @@ config source 'shalla'
 
 config source 'spam404'
        option adb_src 'https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)+/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)+/{print tolower(\$1)}'
        option adb_src_desc 'generic blocklist, infrequent updates, approx. 6.000 entries'
        option enabled '0'
 
 config source 'sysctl'
        option adb_src 'http://sysctl.org/cameleon/hosts'
-       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'broad blocklist, weekly updates, approx. 16.500 entries'
        option enabled '0'
 
 config source 'urlhaus'
        option adb_src 'https://urlhaus.abuse.ch/downloads/rpz'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)+/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)+/{print tolower(\$1)}'
        option adb_src_desc 'urlhaus RPZ domains by abuse.ch, numerous updates on the same day, approx. 3.500 entries'
        option enabled '0'
 
 config source 'ut_capitole'
        option adb_src 'https://dsi.ut-capitole.fr/blacklists/download/blacklists.tar.gz'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'huge blocklist archive subdivided in different categories, daily updates. Check https://dsi.ut-capitole.fr/blacklists/index_en.php for more categories'
+       list adb_src_cat 'publicite'
        list adb_src_cat 'cryptojacking'
        list adb_src_cat 'ddos'
        list adb_src_cat 'malware'
@@ -176,31 +177,36 @@ config source 'ut_capitole'
 
 config source 'whocares'
        option adb_src 'http://someonewhocares.org/hosts/hosts'
-       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^127\.0\.0\.1[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'broad blocklist, weekly updates, approx. 10.000 entries'
        option enabled '0'
 
 config source 'winspy'
        option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt'
-       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 300 entries'
        option enabled '0'
 
 config source 'winhelp'
        option adb_src 'http://winhelp2002.mvps.org/hosts.txt'
-       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
+       option adb_src_rset '/^0\.0\.0\.0[[:space:]]+([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$2)}'
        option adb_src_desc 'broad blocklist, infrequent updates, approx. 13.000 entries'
        option enabled '0'
 
+config source 'youtube'
+       option adb_src 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com'
+       option adb_src_rset 'BEGIN{FS=\",\"}/^(r[0-9]+\.){1,1}([[:alnum:]_-]+\.)+[[:alpha:]]+/{sub(/\./,\"---\");print tolower(\$1)}'
+       option adb_src_desc 'focus on youtube ad-related subdomains, dynamic request API, approx. 150 entries'
+       option enabled '0'
+
 config source 'yoyo'
        option adb_src 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on ad related domains, weekly updates, approx. 2.400 entries'
        option enabled '1'
 
 config source 'zeus'
        option adb_src 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist'
-       option adb_src_rset '/^([^([:space:]|#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
+       option adb_src_rset '/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}'
        option adb_src_desc 'focus on zeus botnet by abuse.ch, daily updates, approx. 400 entries'
        option enabled '0'
-
index b3981039fde3a317eed4ab2aef34a905b2b2580b..2ae2b086bb0af8b2f726882f78be0936534a4582 100755 (executable)
@@ -16,97 +16,97 @@ adb_pidfile="/var/run/adblock.pid"
 
 boot()
 {
-    adb_boot=1
-    rc_procd start_service
+       adb_boot=1
+       rc_procd start_service
 }
 
 start_service()
 {
-    if [ $("${adb_init}" enabled; printf "%u" ${?}) -eq 0 ]
-    then
-        if [ -n "${adb_boot}" ]
-        then
-            local trigger="$(uci_get adblock global adb_trigger)"
-            if [ "${trigger}" != "timed" ]
-            then
-                return 0
-            fi
-        fi
-        local nice="$(uci_get adblock extra adb_nice)"
-        procd_open_instance "adblock"
-        procd_set_param command "${adb_script}" "${@}"
-        procd_set_param pidfile "${adb_pidfile}"
-        procd_set_param nice ${nice:-0}
-        procd_set_param stdout 1
-        procd_set_param stderr 1
-        procd_close_instance
-    fi
+       if [ $("${adb_init}" enabled; printf "%u" ${?}) -eq 0 ]
+       then
+               if [ -n "${adb_boot}" ]
+               then
+                       local trigger="$(uci_get adblock global adb_trigger)"
+                       if [ "${trigger}" != "timed" ]
+                       then
+                               return 0
+                       fi
+               fi
+               local nice="$(uci_get adblock extra adb_nice)"
+               procd_open_instance "adblock"
+               procd_set_param command "${adb_script}" "${@}"
+               procd_set_param pidfile "${adb_pidfile}"
+               procd_set_param nice ${nice:-0}
+               procd_set_param stdout 1
+               procd_set_param stderr 1
+               procd_close_instance
+       fi
 }
 
 reload_service()
 {
-    rc_procd start_service reload
+       rc_procd start_service reload
 }
 
 stop_service()
 {
-    rc_procd "${adb_script}" stop
-    rc_procd start_service
+       rc_procd "${adb_script}" stop
+       rc_procd start_service
 }
 
 restart()
 {
-    rc_procd start_service restart
+       rc_procd start_service restart
 }
 
 suspend()
 {
-    [ -s "${adb_pidfile}" ] && return 1
-    rc_procd "${adb_script}" suspend
+       [ -s "${adb_pidfile}" ] && return 1
+       rc_procd "${adb_script}" suspend
 }
 
 resume()
 {
-    [ -s "${adb_pidfile}" ] && return 1
-    rc_procd "${adb_script}" resume
+       [ -s "${adb_pidfile}" ] && return 1
+       rc_procd "${adb_script}" resume
 }
 
 query()
 {
-    [ -s "${adb_pidfile}" ] && return 1
-    rc_procd "${adb_script}" query "${1}"
+       [ -s "${adb_pidfile}" ] && return 1
+       rc_procd "${adb_script}" query "${1}"
 }
 
 status()
 {
-    local key keylist value rtfile="$(uci_get adblock extra adb_rtfile)"
+       local key keylist value rtfile="$(uci_get adblock extra adb_rtfile)"
 
-    rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
-    if [ -s "${rtfile}" ]
-    then
-        printf "%s\n" "::: adblock runtime information"
-        json_load "$(cat "${rtfile}" 2>/dev/null)"
-        json_select data
-        json_get_keys keylist
-        for key in ${keylist}
-        do
-            json_get_var value "${key}"
-            printf "  + %-15s : %s\n" "${key}" "${value}"
-        done
-    else
-        printf "%s\n" "::: no adblock runtime information available"
-    fi
+       rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
+       if [ -s "${rtfile}" ]
+       then
+               printf "%s\n" "::: adblock runtime information"
+               json_load_file "${rtfile}"
+               json_select data
+               json_get_keys keylist
+               for key in ${keylist}
+               do
+                       json_get_var value "${key}"
+                       printf "  + %-15s : %s\n" "${key}" "${value}"
+               done
+       else
+               printf "%s\n" "::: no adblock runtime information available"
+       fi
 }
 
 service_triggers()
 {
-    local trigger="$(uci_get adblock global adb_trigger)"
-    local delay="$(uci_get adblock extra adb_triggerdelay)"
+       local trigger="$(uci_get adblock global adb_trigger)"
+       local delay="$(uci_get adblock extra adb_triggerdelay)"
 
-    if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
-    then
-        PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
-        procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
-    fi
-    procd_add_reload_trigger "adblock"
+       if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
+       then
+               PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
+               procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
+       fi
+       procd_add_reload_trigger "adblock"
 }
index 6a23db79970066568bf46dcb48d2b1105feea87c..54f0288d578aa6ad383eae821176602de09d77c4 100644 (file)
@@ -10,7 +10,7 @@
 
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-mail_ver="1.0.3"
+mail_ver="1.0.4"
 mail_daemon="$(command -v msmtp)"
 mail_profile="adb_notify"
 #mail_debug="--debug"
@@ -18,22 +18,22 @@ mail_rc=1
 
 # mail header & mail receiver check
 #
+mail_receiver=""
 mail_sender="no-reply@adblock"
-mail_receiver="!!!ChangeMe!!!"
 mail_topic="${HOSTNAME}: adblock notification"
 mail_head="From: ${mail_sender}\nTo: ${mail_receiver}\nSubject: ${mail_topic}\nReply-to: ${mail_sender}\nMime-Version: 1.0\nContent-Type: text/html\nContent-Disposition: inline\n\n"
 
-if [ "${mail_receiver}" = "!!!ChangeMe!!!" ]
+if [ -z "${mail_receiver}" ]
 then
-    logger -p "err" -t "adblock-notify-[${mail_ver}]" "please change the 'mail_receiver' in '/etc/adblock/adblock.notify'"
-    exit ${mail_rc}
+       logger -p "err" -t "adblock-notify-${mail_ver}[${$}]" "please supply/customize the 'mail_receiver' in '/etc/adblock/adblock.notify'"
+       exit ${mail_rc}
 fi
 
 # mail daemon check
 #
 if [ ! -x "${mail_daemon}" ]
 then
-    mail_daemon="$(command -v sendmail)"
+       mail_daemon="$(command -v sendmail)"
 fi
 
 # info preparation
@@ -42,9 +42,9 @@ sys_info="$(strings /etc/banner 2>/dev/null; ubus call system board | sed -e 's/
 adb_info="$(/etc/init.d/adblock status 2>/dev/null)"
 if [ -f "/var/log/messages" ]
 then
-    log_info="$(awk '/adblock-/{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}' /var/log/messages)"
+       log_info="$(awk '/adblock-/{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}' /var/log/messages)"
 else
-    log_info="$(logread -e "adblock-" | awk '{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}')"
+       log_info="$(logread -e "adblock-" | awk '{NR=1;max=79;if(length($0)>max+1)while($0){if(NR==1){print substr($0,1,max),"&#8629;"} else {print " ",substr($0,1,max)}{$0=substr($0,max+1);NR=NR+1}}else print}')"
 fi
 
 # mail body
@@ -59,11 +59,11 @@ mail_text="${mail_text}</pre></body></html>"
 #
 if [ -x "${mail_daemon}" ]
 then
-    printf "%b" "${mail_head}${mail_text}" 2>/dev/null | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" >/dev/null 2>&1
-    mail_rc=${?}
-    logger -p "info" -t "adblock-notify-[${mail_ver}]" "mail sent to '${mail_receiver}' with rc '${mail_rc}'"
+       printf "%b" "${mail_head}${mail_text}" 2>/dev/null | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" >/dev/null 2>&1
+       mail_rc=${?}
+       logger -p "info" -t "adblock-notify-${mail_ver}[${$}]" "mail sent to '${mail_receiver}' with rc '${mail_rc}'"
 else
-    logger -p "err" -t "adblock-notify-[${mail_ver}]" "msmtp mail daemon not found"
+       logger -p "err" -t "adblock-notify-${mail_ver}[${$}]" "msmtp mail daemon not found"
 fi
 
 exit ${mail_rc}
index e91f8e9d7a7d49936c30303f949cca34c5111299..a8eb1563be17e2312060a166f7b8ac5f78a35253 100755 (executable)
@@ -10,7 +10,7 @@
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="3.5.4-2"
+adb_ver="3.5.5-2"
 adb_sysver="unknown"
 adb_enabled=0
 adb_debug=0
@@ -44,1037 +44,1025 @@ adb_pidfile="/var/run/adblock.pid"
 #
 f_envload()
 {
-    local dns_up sys_call sys_desc sys_model sys_ver cnt=0
-
-    # get system information
-    #
-    sys_call="$(ubus -S call system board 2>/dev/null)"
-    if [ -n "${sys_call}" ]
-    then
-        sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
-        sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
-        sys_ver="$(cat /etc/turris-version 2>/dev/null)"
-        if [ -n "${sys_ver}" ]
-        then
-            sys_desc="${sys_desc}/${sys_ver}"
-        fi
-        adb_sysver="${sys_model}, ${sys_desc}"
-    fi
-
-    # check hash utility
-    #
-    if [ ! -x "${adb_hashutil}" ]
-    then
-        adb_hashutil="$(command -v md5sum)"
-    fi
-
-    # source in system libraries
-    #
-    if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
-    then
-        . "/lib/functions.sh"
-        . "/usr/share/libubox/jshn.sh"
-    else
-        f_log "err" "system libraries not found"
-    fi
-
-    # parse 'global' and 'extra' section by callback
-    #
-    config_cb()
-    {
-        local type="${1}"
-        if [ "${type}" = "adblock" ]
-        then
-            option_cb()
-            {
-                local option="${1}"
-                local value="${2}"
-                eval "${option}=\"${value}\""
-            }
-        else
-            reset_cb
-        fi
-    }
-
-    # parse 'source' typed sections
-    #
-    parse_config()
-    {
-        local value opt section="${1}" options="enabled adb_src adb_src_rset adb_src_cat"
-        eval "adb_sources=\"${adb_sources} ${section}\""
-        for opt in ${options}
-        do
-            config_get value "${section}" "${opt}"
-            if [ -n "${value}" ]
-            then
-                eval "${opt}_${section}=\"${value}\""
-            fi
-        done
-    }
-
-    # load adblock config
-    #
-    config_load adblock
-    config_foreach parse_config source
-
-    # check dns backend
-    #
-    case "${adb_dns}" in
-        dnsmasq)
-            adb_dnsinstance="${adb_dnsinstance:-"0"}"
-            adb_dnsuser="${adb_dnsuser:-"dnsmasq"}"
-            adb_dnsdir="${adb_dnsdir:-"/tmp"}"
-            adb_dnsheader=""
-            adb_dnsdeny="awk '{print \"server=/\"\$0\"/\"}'"
-            adb_dnsallow="awk '{print \"server=/\"\$0\"/#\"}'"
-            adb_dnshalt="server=/#/"
-        ;;
-        unbound)
-            adb_dnsinstance="${adb_dnsinstance:-"0"}"
-            adb_dnsuser="${adb_dnsuser:-"unbound"}"
-            adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
-            adb_dnsheader=""
-            adb_dnsdeny="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
-            adb_dnsallow="awk '{print \"local-zone: \042\"\$0\"\042 transparent\"}'"
-            adb_dnshalt="local-zone: \".\" static"
-        ;;
-        named)
-            adb_dnsinstance="${adb_dnsinstance:-"0"}"
-            adb_dnsuser="${adb_dnsuser:-"bind"}"
-            adb_dnsdir="${adb_dnsdir:-"/var/lib/bind"}"
-            adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS localhost."
-            adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
-            adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
-            adb_dnshalt="* CNAME ."
-        ;;
-        kresd)
-            adb_dnsinstance="${adb_dnsinstance:-"0"}"
-            adb_dnsuser="${adb_dnsuser:-"root"}"
-            adb_dnsdir="${adb_dnsdir:-"/etc/kresd"}"
-            adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS  localhost."
-            adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
-            adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
-            adb_dnshalt="* CNAME ."
-        ;;
-        dnscrypt-proxy)
-            adb_dnsinstance="${adb_dnsinstance:-"0"}"
-            adb_dnsuser="${adb_dnsuser:-"nobody"}"
-            adb_dnsdir="${adb_dnsdir:-"/tmp"}"
-            adb_dnsheader=""
-            adb_dnsdeny="awk '{print \$0}'"
-            adb_dnsallow=""
-            adb_dnshalt=""
-        ;;
-    esac
-
-    # check adblock status
-    #
-    if [ ${adb_enabled} -eq 0 ]
-    then
-        f_extconf
-        f_temp
-        f_rmdns
-        f_jsnup
-        f_log "info" "adblock is currently disabled, please set adb_enabled to '1' to use this service"
-        exit 0
-    fi
-
-    if [ -d "${adb_dnsdir}" ] && [ ! -f "${adb_dnsdir}/${adb_dnsfile}" ]
-    then
-        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
-    fi
-
-    if [ "${adb_action}" = "start" ] && [ "${adb_trigger}" = "timed" ]
-    then
-        sleep ${adb_triggerdelay}
-    fi
-
-    while [ ${cnt} -le 30 ]
-    do
-        dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" 2>/dev/null | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running" 2>/dev/null)"
-        if [ "${dns_up}" = "true" ]
-        then
-            break
-        fi
-        sleep 1
-        cnt=$((cnt+1))
-    done
-
-    if [ "${dns_up}" != "true" ] || [ -z "${adb_dns}" ] || [ ! -x "$(command -v ${adb_dns})" ]
-    then
-        f_log "err" "'${adb_dns}' not running or not executable"
-    elif [ ! -d "${adb_dnsdir}" ]
-    then
-        f_log "err" "'${adb_dnsdir}' backend directory not found"
-    fi
+       local dns_up sys_call sys_desc sys_model sys_ver cnt=0
+
+       # get system information
+       #
+       sys_call="$(ubus -S call system board 2>/dev/null)"
+       if [ -n "${sys_call}" ]
+       then
+               sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
+               sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
+               sys_ver="$(cat /etc/turris-version 2>/dev/null)"
+               if [ -n "${sys_ver}" ]
+               then
+                       sys_desc="${sys_desc}/${sys_ver}"
+               fi
+               adb_sysver="${sys_model}, ${sys_desc}"
+       fi
+
+       # check hash utility
+       #
+       if [ ! -x "${adb_hashutil}" ]
+       then
+               adb_hashutil="$(command -v md5sum)"
+       fi
+
+       # parse 'global' and 'extra' section by callback
+       #
+       config_cb()
+       {
+               local type="${1}"
+               if [ "${type}" = "adblock" ]
+               then
+                       option_cb()
+                       {
+                               local option="${1}"
+                               local value="${2}"
+                               eval "${option}=\"${value}\""
+                       }
+               else
+                       reset_cb
+               fi
+       }
+
+       # parse 'source' typed sections
+       #
+       parse_config()
+       {
+               local value opt section="${1}" options="enabled adb_src adb_src_rset adb_src_cat"
+               eval "adb_sources=\"${adb_sources} ${section}\""
+               for opt in ${options}
+               do
+                       config_get value "${section}" "${opt}"
+                       if [ -n "${value}" ]
+                       then
+                               eval "${opt}_${section}=\"${value}\""
+                       fi
+               done
+       }
+
+       # load adblock config
+       #
+       config_load adblock
+       config_foreach parse_config source
+
+       # check dns backend
+       #
+       case "${adb_dns}" in
+               dnsmasq)
+                       adb_dnsinstance="${adb_dnsinstance:-"0"}"
+                       adb_dnsuser="${adb_dnsuser:-"dnsmasq"}"
+                       adb_dnsdir="${adb_dnsdir:-"/tmp"}"
+                       adb_dnsheader=""
+                       adb_dnsdeny="awk '{print \"server=/\"\$0\"/\"}'"
+                       adb_dnsallow="awk '{print \"server=/\"\$0\"/#\"}'"
+                       adb_dnshalt="server=/#/"
+               ;;
+               unbound)
+                       adb_dnsinstance="${adb_dnsinstance:-"0"}"
+                       adb_dnsuser="${adb_dnsuser:-"unbound"}"
+                       adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
+                       adb_dnsheader=""
+                       adb_dnsdeny="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
+                       adb_dnsallow="awk '{print \"local-zone: \042\"\$0\"\042 transparent\"}'"
+                       adb_dnshalt="local-zone: \".\" static"
+               ;;
+               named)
+                       adb_dnsinstance="${adb_dnsinstance:-"0"}"
+                       adb_dnsuser="${adb_dnsuser:-"bind"}"
+                       adb_dnsdir="${adb_dnsdir:-"/var/lib/bind"}"
+                       adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS localhost."
+                       adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
+                       adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
+                       adb_dnshalt="* CNAME ."
+               ;;
+               kresd)
+                       adb_dnsinstance="${adb_dnsinstance:-"0"}"
+                       adb_dnsuser="${adb_dnsuser:-"root"}"
+                       adb_dnsdir="${adb_dnsdir:-"/etc/kresd"}"
+                       adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (1 6h 1h 1w 2h)"$'\n'"  IN NS  localhost."
+                       adb_dnsdeny="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
+                       adb_dnsallow="awk '{print \"\"\$0\" CNAME rpz-passthru.\n*.\"\$0\" CNAME rpz-passthru.\"}'"
+                       adb_dnshalt="* CNAME ."
+               ;;
+               dnscrypt-proxy)
+                       adb_dnsinstance="${adb_dnsinstance:-"0"}"
+                       adb_dnsuser="${adb_dnsuser:-"nobody"}"
+                       adb_dnsdir="${adb_dnsdir:-"/tmp"}"
+                       adb_dnsheader=""
+                       adb_dnsdeny="awk '{print \$0}'"
+                       adb_dnsallow=""
+                       adb_dnshalt=""
+               ;;
+       esac
+
+       # check adblock status
+       #
+       if [ ${adb_enabled} -eq 0 ]
+       then
+               f_extconf
+               f_temp
+               f_rmdns
+               f_jsnup "disabled"
+               f_log "info" "adblock is currently disabled, please set adb_enabled to '1' to use this service"
+               exit 0
+       fi
+
+       if [ -d "${adb_dnsdir}" ] && [ ! -f "${adb_dnsdir}/${adb_dnsfile}" ]
+       then
+               printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
+       fi
+
+       if [ "${adb_action}" = "start" ] && [ "${adb_trigger}" = "timed" ]
+       then
+               sleep ${adb_triggerdelay}
+       fi
+
+       while [ ${cnt} -le 30 ]
+       do
+               dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" 2>/dev/null | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running" 2>/dev/null)"
+               if [ "${dns_up}" = "true" ]
+               then
+                       break
+               fi
+               sleep 1
+               cnt=$((cnt+1))
+       done
+
+       if [ "${dns_up}" != "true" ] || [ -z "${adb_dns}" ] || [ ! -x "$(command -v ${adb_dns})" ]
+       then
+               f_log "err" "'${adb_dns}' not running or not executable"
+       elif [ ! -d "${adb_dnsdir}" ]
+       then
+               f_log "err" "'${adb_dnsdir}' backend directory not found"
+       fi
 }
 
 # check environment
 #
 f_envcheck()
 {
-    local ssl_lib
-
-    # check external uci config files
-    #
-    f_extconf
-
-    # check fetch utility
-    #
-    case "${adb_fetchutil}" in
-        uclient-fetch)
-            if [ -f "/lib/libustream-ssl.so" ]
-            then
-                adb_fetchparm="${adb_fetchparm:-"--timeout=10 --no-check-certificate -O"}"
-                ssl_lib="libustream-ssl"
-            else
-                adb_fetchparm="${adb_fetchparm:-"--timeout=10 -O"}"
-            fi
-        ;;
-        wget)
-            adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"}"
-            ssl_lib="built-in"
-        ;;
-        wget-nossl)
-            adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 -O"}"
-        ;;
-        busybox)
-            adb_fetchparm="${adb_fetchparm:-"-O"}"
-        ;;
-        curl)
-            adb_fetchparm="${adb_fetchparm:-"--connect-timeout 10 --insecure -o"}"
-            ssl_lib="built-in"
-        ;;
-        aria2c)
-            adb_fetchparm="${adb_fetchparm:-"--timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o"}"
-            ssl_lib="built-in"
-        ;;
-    esac
-    adb_fetchutil="$(command -v "${adb_fetchutil}")"
-
-    if [ ! -x "${adb_fetchutil}" ] || [ -z "${adb_fetchutil}" ] || [ -z "${adb_fetchparm}" ]
-    then
-        f_log "err" "download utility not found, please install 'uclient-fetch' with 'libustream-mbedtls' or the full 'wget' package"
-    fi
-    adb_fetchinfo="${adb_fetchutil} (${ssl_lib:-"-"})"
-
-    f_temp
-    f_jsnup "running"
-    f_log "info" "start adblock processing (${adb_action})"
+       local ssl_lib
+
+       # startup message
+       #
+       f_log "info" "adblock instance started ::: action: ${adb_action}, priority: ${adb_nice:-"0"}, pid: ${$}"
+       f_jsnup "running"
+
+       # check external uci config files
+       #
+       f_extconf
+
+       # check fetch utility
+       #
+       case "${adb_fetchutil}" in
+               uclient-fetch)
+                       if [ -f "/lib/libustream-ssl.so" ]
+                       then
+                               adb_fetchparm="${adb_fetchparm:-"--timeout=10 --no-check-certificate -O"}"
+                               ssl_lib="libustream-ssl"
+                       else
+                               adb_fetchparm="${adb_fetchparm:-"--timeout=10 -O"}"
+                       fi
+               ;;
+               wget)
+                       adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"}"
+                       ssl_lib="built-in"
+               ;;
+               wget-nossl)
+                       adb_fetchparm="${adb_fetchparm:-"--no-cache --no-cookies --max-redirect=0 --timeout=10 -O"}"
+               ;;
+               busybox)
+                       adb_fetchparm="${adb_fetchparm:-"-O"}"
+               ;;
+               curl)
+                       adb_fetchparm="${adb_fetchparm:-"--connect-timeout 10 --insecure -o"}"
+                       ssl_lib="built-in"
+               ;;
+               aria2c)
+                       adb_fetchparm="${adb_fetchparm:-"--timeout=10 --allow-overwrite=true --auto-file-renaming=false --check-certificate=false -o"}"
+                       ssl_lib="built-in"
+               ;;
+       esac
+       adb_fetchutil="$(command -v "${adb_fetchutil}")"
+
+       if [ ! -x "${adb_fetchutil}" ] || [ -z "${adb_fetchutil}" ] || [ -z "${adb_fetchparm}" ]
+       then
+               f_log "err" "download utility not found, please install 'uclient-fetch' with 'libustream-mbedtls' or the full 'wget' package"
+       fi
+       adb_fetchinfo="${adb_fetchutil} (${ssl_lib:-"-"})"
+       f_temp
 }
 
 # create temporary files and directories
 #
 f_temp()
 {
-    if [ -z "${adb_tmpdir}" ]
-    then
-        adb_tmpdir="$(mktemp -p /tmp -d)"
-        adb_tmpload="$(mktemp -p ${adb_tmpdir} -tu)"
-        adb_tmpfile="$(mktemp -p ${adb_tmpdir} -tu)"
-    fi
-    if [ ! -s "${adb_pidfile}" ]
-    then
-        printf '%s' "${$}" > "${adb_pidfile}"
-    fi
+       if [ -z "${adb_tmpdir}" ]
+       then
+               adb_tmpdir="$(mktemp -p /tmp -d)"
+               adb_tmpload="$(mktemp -p ${adb_tmpdir} -tu)"
+               adb_tmpfile="$(mktemp -p ${adb_tmpdir} -tu)"
+       fi
+       if [ ! -s "${adb_pidfile}" ]
+       then
+               printf '%s' "${$}" > "${adb_pidfile}"
+       fi
 }
 
 # remove temporary files and directories
 #
 f_rmtemp()
 {
-    if [ -d "${adb_tmpdir}" ]
-    then
-        rm -rf "${adb_tmpdir}"
-    fi
-    > "${adb_pidfile}"
+       if [ -d "${adb_tmpdir}" ]
+       then
+               rm -rf "${adb_tmpdir}"
+       fi
+       > "${adb_pidfile}"
 }
 
 # remove dns related files and directories
 #
 f_rmdns()
 {
-    if [ -n "${adb_dns}" ]
-    then
-        f_hash
-        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
-        > "${adb_dnsdir}/.${adb_dnsfile}"
-        > "${adb_rtfile}"
-        rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
-        f_hash
-        if [ ${?} -eq 1 ]
-        then
-            f_dnsup
-        fi
-        f_rmtemp
-    fi
-    f_log "debug" "f_rmdns::: dns: ${adb_dns}, dns_dir: ${adb_dnsdir}, dns_prefix: ${adb_dnsprefix}, dns_file: ${adb_dnsfile}, rt_file: ${adb_rtfile}, backup_dir: ${adb_backupdir}"
+       if [ -n "${adb_dns}" ]
+       then
+               f_hash
+               printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
+               > "${adb_dnsdir}/.${adb_dnsfile}"
+               > "${adb_rtfile}"
+               rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
+               f_hash
+               if [ ${?} -eq 1 ]
+               then
+                       f_dnsup
+               fi
+               f_rmtemp
+       fi
+       f_log "debug" "f_rmdns::: dns: ${adb_dns}, dns_dir: ${adb_dnsdir}, dns_prefix: ${adb_dnsprefix}, dns_file: ${adb_dnsfile}, rt_file: ${adb_rtfile}, backup_dir: ${adb_backupdir}"
 }
 
 # commit uci changes
 #
 f_uci()
 {
-    local change config="${1}"
-
-    if [ -n "${config}" ]
-    then
-        change="$(uci -q changes "${config}" | awk '{ORS=" "; print $0}')"
-        if [ -n "${change}" ]
-        then
-            uci -q commit "${config}"
-            case "${config}" in
-                firewall)
-                    /etc/init.d/firewall reload >/dev/null 2>&1
-                ;;
-                *)
-                    /etc/init.d/"${adb_dns}" reload >/dev/null 2>&1
-                ;;
-            esac
-        fi
-    fi
-    f_log "debug" "f_uci  ::: config: ${config}, change: ${change}"
+       local change config="${1}"
+
+       if [ -n "${config}" ]
+       then
+               change="$(uci -q changes "${config}" | awk '{ORS=" "; print $0}')"
+               if [ -n "${change}" ]
+               then
+                       uci_commit "${config}"
+                       case "${config}" in
+                               firewall)
+                                       /etc/init.d/firewall reload >/dev/null 2>&1
+                               ;;
+                               *)
+                                       /etc/init.d/"${adb_dns}" reload >/dev/null 2>&1
+                               ;;
+                       esac
+               fi
+       fi
+       f_log "debug" "f_uci  ::: config: ${config}, change: ${change}"
 }
 
 # list/overall count
 #
 f_count()
 {
-    local mode="${1}"
-
-    adb_cnt=0
-    if [ -s "${adb_dnsdir}/${adb_dnsfile}" ] && ([ -z "${mode}" ] || [ "${mode}" = "final" ])
-    then
-        adb_cnt="$(( $(wc -l 2>/dev/null < "${adb_dnsdir}/${adb_dnsfile}") - $(wc -l 2>/dev/null < "${adb_tmpdir}/tmp.add_whitelist") ))"
-        if [ "${adb_dns}" = "named" ] || [ "${adb_dns}" = "kresd" ]
-        then
-            adb_cnt="$(( (${adb_cnt} - $(printf '%s' "${adb_dnsheader}" | grep -c "^")) / 2 ))"
-        fi
-    elif [ -s "${adb_tmpfile}" ]
-    then
-        adb_cnt="$(wc -l 2>/dev/null < "${adb_tmpfile}")"
-    fi
+       local mode="${1}"
+
+       adb_cnt=0
+       if [ -s "${adb_dnsdir}/${adb_dnsfile}" ] && ([ -z "${mode}" ] || [ "${mode}" = "final" ])
+       then
+               adb_cnt="$(( $(wc -l 2>/dev/null < "${adb_dnsdir}/${adb_dnsfile}") - $(wc -l 2>/dev/null < "${adb_tmpdir}/tmp.add_whitelist") ))"
+               if [ "${adb_dns}" = "named" ] || [ "${adb_dns}" = "kresd" ]
+               then
+                       adb_cnt="$(( (${adb_cnt} - $(printf '%s' "${adb_dnsheader}" | grep -c "^")) / 2 ))"
+               fi
+       elif [ -s "${adb_tmpfile}" ]
+       then
+               adb_cnt="$(wc -l 2>/dev/null < "${adb_tmpfile}")"
+       fi
 }
 
 # set external config options
 #
 f_extconf()
 {
-    local uci_config port port_list="53 853 5353"
-
-    case "${adb_dns}" in
-        dnsmasq)
-            uci_config="dhcp"
-            if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci -q get dhcp.@dnsmasq[${adb_dnsinstance}].serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
-            then
-                uci -q set dhcp.@dnsmasq[${adb_dnsinstance}].serversfile="${adb_dnsdir}/${adb_dnsfile}"
-            elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci -q get dhcp.@dnsmasq[${adb_dnsinstance}].serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
-            then
-                uci -q delete dhcp.@dnsmasq[${adb_dnsinstance}].serversfile
-            fi
-        ;;
-        kresd)
-            uci_config="resolver"
-            if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci -q get resolver.kresd.rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
-            then
-                uci -q add_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
-            elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci -q get resolver.kresd.rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
-            then
-                uci -q del_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
-            fi
-            if [ ${adb_enabled} -eq 1 ] && [ ${adb_dnsflush} -eq 0 ] && [ "$(uci -q get resolver.kresd.keep_cache)" != "1" ]
-            then
-                uci -q set resolver.kresd.keep_cache="1"
-            elif [ ${adb_enabled} -eq 0 ] || ([ ${adb_dnsflush} -eq 1 ] && [ "$(uci -q get resolver.kresd.keep_cache)" = "1" ])
-            then
-                uci -q set resolver.kresd.keep_cache="0"
-            fi
-        ;;
-    esac
-    f_uci "${uci_config}"
-
-    uci_config="firewall"
-    if [ ${adb_enabled} -eq 1 ] && [ ${adb_forcedns} -eq 1 ] && \
-       [ -z "$(uci -q get firewall.adblock_dns_53)" ] && [ $(/etc/init.d/firewall enabled; printf '%u' ${?}) -eq 0 ]
-    then
-        for port in ${port_list}
-        do
-            uci_add firewall "redirect" "adblock_dns_${port}"
-            uci_set firewall "adblock_dns_${port}" "name" "Adblock DNS, port ${port}"
-            uci_set firewall "adblock_dns_${port}" "src" "lan"
-            uci_set firewall "adblock_dns_${port}" "proto" "tcp udp"
-            uci_set firewall "adblock_dns_${port}" "src_dport" "${port}"
-            uci_set firewall "adblock_dns_${port}" "dest_port" "${port}"
-            uci_set firewall "adblock_dns_${port}" "target" "DNAT"
-        done
-    elif [ -n "$(uci -q get firewall.adblock_dns_53)" ] && ([ ${adb_enabled} -eq 0 ] || [ ${adb_forcedns} -eq 0 ])
-    then
-        for port in ${port_list}
-        do
-            uci_remove firewall "adblock_dns_${port}"
-        done
-    fi
-    f_uci "${uci_config}"
+       local uci_config port port_list="53 853 5353"
+
+       case "${adb_dns}" in
+               dnsmasq)
+                       uci_config="dhcp"
+                       if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                       then
+                               uci_set dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile "${adb_dnsdir}/${adb_dnsfile}"
+                       elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                       then
+                               uci_remove dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile
+                       fi
+               ;;
+               kresd)
+                       uci_config="resolver"
+                       if [ ${adb_enabled} -eq 1 ] && [ -z "$(uci_get resolver kresd rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                       then
+                               uci -q add_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
+                       elif [ ${adb_enabled} -eq 0 ] && [ -n "$(uci_get resolver kresd rpz_file | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                       then
+                               uci -q del_list resolver.kresd.rpz_file="${adb_dnsdir}/${adb_dnsfile}"
+                       fi
+                       if [ ${adb_enabled} -eq 1 ] && [ ${adb_dnsflush} -eq 0 ] && [ "$(uci_get resolver kresd keep_cache)" != "1" ]
+                       then
+                               uci_set resolver kresd keep_cache "1"
+                       elif [ ${adb_enabled} -eq 0 ] || ([ ${adb_dnsflush} -eq 1 ] && [ "$(uci_get resolver kresd keep_cache)" = "1" ])
+                       then
+                               uci_set resolver kresd keep_cache "0"
+                       fi
+               ;;
+       esac
+       f_uci "${uci_config}"
+
+       uci_config="firewall"
+       if [ ${adb_enabled} -eq 1 ] && [ ${adb_forcedns} -eq 1 ] && \
+               [ -z "$(uci_get firewall adblock_dns_53)" ] && [ $(/etc/init.d/firewall enabled; printf '%u' ${?}) -eq 0 ]
+       then
+               for port in ${port_list}
+               do
+                       uci_add firewall "redirect" "adblock_dns_${port}"
+                       uci_set firewall "adblock_dns_${port}" "name" "Adblock DNS, port ${port}"
+                       uci_set firewall "adblock_dns_${port}" "src" "lan"
+                       uci_set firewall "adblock_dns_${port}" "proto" "tcp udp"
+                       uci_set firewall "adblock_dns_${port}" "src_dport" "${port}"
+                       uci_set firewall "adblock_dns_${port}" "dest_port" "${port}"
+                       uci_set firewall "adblock_dns_${port}" "target" "DNAT"
+               done
+       elif [ -n "$(uci_get firewall adblock_dns_53)" ] && ([ ${adb_enabled} -eq 0 ] || [ ${adb_forcedns} -eq 0 ])
+       then
+               for port in ${port_list}
+               do
+                       uci_remove firewall "adblock_dns_${port}"
+               done
+       fi
+       f_uci "${uci_config}"
 }
 
 # restart of the dns backend
 #
 f_dnsup()
 {
-    local dns_up cache_util cache_rc cnt=0
-
-    if [ ${adb_dnsflush} -eq 0 ] && [ ${adb_enabled} -eq 1 ] && [ "${adb_rc}" -eq 0 ]
-    then
-        case "${adb_dns}" in
-            dnsmasq)
-                killall -q -HUP "${adb_dns}"
-                cache_rc=${?}
-            ;;
-            unbound)
-                cache_util="$(command -v unbound-control)"
-                if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -f "${adb_dnsdir}"/unbound.conf ]
-                then
-                    "${cache_util}" -c "${adb_dnsdir}"/unbound.conf dump_cache > "${adb_tmpdir}"/adb_cache.dump 2>/dev/null
-                fi
-                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
-            ;;
-            kresd)
-                cache_util="keep_cache"
-                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
-                cache_rc=${?}
-            ;;
-            named)
-                cache_util="$(command -v rndc)"
-                if [ -x "${cache_util}" ] && [ -f /etc/bind/rndc.conf ]
-                then
-                    "${cache_util}" -c /etc/bind/rndc.conf reload >/dev/null 2>&1
-                    cache_rc=${?}
-                else
-                    "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
-                fi
-            ;;
-            *)
-                "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
-            ;;
-        esac
-    else
-        "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
-    fi
-
-    adb_rc=1
-    while [ ${cnt} -le 10 ]
-    do
-        dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
-        if [ "${dns_up}" = "true" ]
-        then
-            case "${adb_dns}" in
-                unbound)
-                    cache_util="$(command -v unbound-control)"
-                    if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -s "${adb_tmpdir}"/adb_cache.dump ]
-                    then
-                        while [ ${cnt} -le 10 ]
-                        do
-                            "${cache_util}" -c "${adb_dnsdir}"/unbound.conf load_cache < "${adb_tmpdir}"/adb_cache.dump >/dev/null 2>&1
-                            cache_rc=${?}
-                            if [ ${cache_rc} -eq 0 ]
-                            then
-                                break
-                            fi
-                            cnt=$((cnt+1))
-                            sleep 1
-                        done
-                    fi
-                ;;
-            esac
-            adb_rc=0
-            break
-        fi
-        cnt=$((cnt+1))
-        sleep 1
-    done
-    f_log "debug" "f_dnsup::: cache_util: ${cache_util:-"-"}, cache_rc: ${cache_rc:-"-"}, cache_flush: ${adb_dnsflush}, cache_cnt: ${cnt}, rc: ${adb_rc}"
-    return ${adb_rc}
+       local dns_up cache_util cache_rc cnt=0
+
+       if [ ${adb_dnsflush} -eq 0 ] && [ ${adb_enabled} -eq 1 ] && [ "${adb_rc}" -eq 0 ]
+       then
+               case "${adb_dns}" in
+                       dnsmasq)
+                               killall -q -HUP "${adb_dns}"
+                               cache_rc=${?}
+                       ;;
+                       unbound)
+                               cache_util="$(command -v unbound-control)"
+                               if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -f "${adb_dnsdir}"/unbound.conf ]
+                               then
+                                       "${cache_util}" -c "${adb_dnsdir}"/unbound.conf dump_cache > "${adb_tmpdir}"/adb_cache.dump 2>/dev/null
+                               fi
+                               "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                       ;;
+                       kresd)
+                               cache_util="keep_cache"
+                               "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                               cache_rc=${?}
+                       ;;
+                       named)
+                               cache_util="$(command -v rndc)"
+                               if [ -x "${cache_util}" ] && [ -f /etc/bind/rndc.conf ]
+                               then
+                                       "${cache_util}" -c /etc/bind/rndc.conf reload >/dev/null 2>&1
+                                       cache_rc=${?}
+                               else
+                                       "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                               fi
+                       ;;
+                       *)
+                               "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+                       ;;
+               esac
+       else
+               "/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
+       fi
+
+       adb_rc=1
+       while [ ${cnt} -le 10 ]
+       do
+               dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
+               if [ "${dns_up}" = "true" ]
+               then
+                       case "${adb_dns}" in
+                               unbound)
+                                       cache_util="$(command -v unbound-control)"
+                                       if [ -x "${cache_util}" ] && [ -d "${adb_tmpdir}" ] && [ -s "${adb_tmpdir}"/adb_cache.dump ]
+                                       then
+                                               while [ ${cnt} -le 10 ]
+                                               do
+                                                       "${cache_util}" -c "${adb_dnsdir}"/unbound.conf load_cache < "${adb_tmpdir}"/adb_cache.dump >/dev/null 2>&1
+                                                       cache_rc=${?}
+                                                       if [ ${cache_rc} -eq 0 ]
+                                                       then
+                                                               break
+                                                       fi
+                                                       cnt=$((cnt+1))
+                                                       sleep 1
+                                               done
+                                       fi
+                               ;;
+                       esac
+                       adb_rc=0
+                       break
+               fi
+               cnt=$((cnt+1))
+               sleep 1
+       done
+       f_log "debug" "f_dnsup::: cache_util: ${cache_util:-"-"}, cache_rc: ${cache_rc:-"-"}, cache_flush: ${adb_dnsflush}, cache_cnt: ${cnt}, rc: ${adb_rc}"
+       return ${adb_rc}
 }
 
 # backup/restore/remove blocklists
 #
 f_list()
 {
-    local file mode="${1}" in_rc="${adb_rc}"
-
-    case "${mode}" in
-        backup)
-            if [ -d "${adb_backupdir}" ]
-            then
-                gzip -cf "${adb_tmpfile}" 2>/dev/null > "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
-                adb_rc=${?}
-            fi
-        ;;
-        restore)
-            if [ -d "${adb_backupdir}" ] && [ -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" ]
-            then
-                gunzip -cf "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" 2>/dev/null > "${adb_tmpfile}"
-                adb_rc=${?}
-            fi
-        ;;
-        remove)
-            if [ -d "${adb_backupdir}" ]
-            then
-                rm -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
-            fi
-            adb_rc=${?}
-        ;;
-        merge)
-            for file in "${adb_tmpfile}".*
-            do
-                cat "${file}" 2>/dev/null >> "${adb_tmpdir}/${adb_dnsfile}"
-                if [ ${?} -ne 0 ]
-                then
-                    adb_rc=${?}
-                    break
-                fi
-                rm -f "${file}"
-            done
-            adb_tmpfile="${adb_tmpdir}/${adb_dnsfile}"
-        ;;
-        final)
-            > "${adb_dnsdir}/${adb_dnsfile}"
-
-            if [ -s "${adb_tmpdir}/tmp.add_whitelist" ]
-            then
-                cat "${adb_tmpdir}/tmp.add_whitelist" >> "${adb_dnsdir}/${adb_dnsfile}"
-            fi
-
-            if [ -s "${adb_tmpdir}/tmp.rem_whitelist" ]
-            then
-                grep -vf "${adb_tmpdir}/tmp.rem_whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsdeny}" >> "${adb_dnsdir}/${adb_dnsfile}"
-            else
-                eval "${adb_dnsdeny}" "${adb_tmpdir}/${adb_dnsfile}" >> "${adb_dnsdir}/${adb_dnsfile}"
-            fi
-
-            if [ ${?} -eq 0 ] && [ -n "${adb_dnsheader}" ]
-            then
-                printf '%s\n' "${adb_dnsheader}" | cat - "${adb_dnsdir}/${adb_dnsfile}" > "${adb_tmpdir}/${adb_dnsfile}"
-                cat "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
-            fi
-            adb_rc=${?}
-        ;;
-    esac
-    f_count "${mode}"
-    f_log "debug" "f_list ::: name: ${src_name:-"-"}, mode: ${mode}, cnt: ${adb_cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
+       local file mode="${1}" in_rc="${adb_rc}"
+
+       case "${mode}" in
+               backup)
+                       if [ -d "${adb_backupdir}" ]
+                       then
+                               gzip -cf "${adb_tmpfile}" 2>/dev/null > "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
+                               adb_rc=${?}
+                       fi
+               ;;
+               restore)
+                       if [ -d "${adb_backupdir}" ] && [ -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" ]
+                       then
+                               gunzip -cf "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz" 2>/dev/null > "${adb_tmpfile}"
+                               adb_rc=${?}
+                       fi
+               ;;
+               remove)
+                       if [ -d "${adb_backupdir}" ]
+                       then
+                               rm -f "${adb_backupdir}/${adb_dnsprefix}.${src_name}.gz"
+                       fi
+                       adb_rc=${?}
+               ;;
+               merge)
+                       for file in "${adb_tmpfile}".*
+                       do
+                               cat "${file}" 2>/dev/null >> "${adb_tmpdir}/${adb_dnsfile}"
+                               if [ ${?} -ne 0 ]
+                               then
+                                       adb_rc=${?}
+                                       break
+                               fi
+                               rm -f "${file}"
+                       done
+                       adb_tmpfile="${adb_tmpdir}/${adb_dnsfile}"
+               ;;
+               final)
+                       > "${adb_dnsdir}/${adb_dnsfile}"
+
+                       if [ -s "${adb_tmpdir}/tmp.add_whitelist" ]
+                       then
+                               cat "${adb_tmpdir}/tmp.add_whitelist" >> "${adb_dnsdir}/${adb_dnsfile}"
+                       fi
+
+                       if [ -s "${adb_tmpdir}/tmp.rem_whitelist" ]
+                       then
+                               grep -vf "${adb_tmpdir}/tmp.rem_whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsdeny}" >> "${adb_dnsdir}/${adb_dnsfile}"
+                       else
+                               eval "${adb_dnsdeny}" "${adb_tmpdir}/${adb_dnsfile}" >> "${adb_dnsdir}/${adb_dnsfile}"
+                       fi
+
+                       if [ ${?} -eq 0 ] && [ -n "${adb_dnsheader}" ]
+                       then
+                               printf '%s\n' "${adb_dnsheader}" | cat - "${adb_dnsdir}/${adb_dnsfile}" > "${adb_tmpdir}/${adb_dnsfile}"
+                               mv -f "${adb_tmpdir}/${adb_dnsfile}" "${adb_dnsdir}/${adb_dnsfile}"
+                       fi
+                       adb_rc=${?}
+               ;;
+       esac
+       f_count "${mode}"
+       f_log "debug" "f_list ::: name: ${src_name:-"-"}, mode: ${mode}, cnt: ${adb_cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
 }
 
 # top level domain compression
 #
 f_tld()
 {
-    local cnt cnt_srt cnt_tld source="${1}" temp="${1}.tld"
-
-    cnt="$(wc -l 2>/dev/null < "${source}")"
-    sort -u "${source}" > "${temp}"
-    if [ ${?} -eq 0 ]
-    then
-        cnt_srt="$(wc -l 2>/dev/null < "${temp}")"
-        awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${temp}" > "${source}"
-        if [ ${?} -eq 0 ]
-        then
-            sort "${source}" > "${temp}"
-            if [ ${?} -eq 0 ]
-            then
-                awk '{if(NR==1){tld=$NF};while(getline){if($NF!~tld"\\."){print tld;tld=$NF}}print tld}' "${temp}" > "${source}"
-                if [ ${?} -eq 0 ]
-                then
-                    awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${source}" > "${temp}"
-                    if [ ${?} -eq 0 ]
-                    then
-                        sort "${temp}" > "${source}"
-                        if [ ${?} -eq 0 ]
-                        then
-                            cnt_tld="$(wc -l 2>/dev/null < "${source}")"
-                        else
-                            cat "${temp}" > "${source}"
-                        fi
-                    fi
-                else
-                    cat "${temp}" > "${source}"
-                fi
-            fi
-        else
-            cat "${temp}" > "${source}"
-        fi
-    fi
-    rm -f "${temp}"
-    f_log "debug" "f_tld  ::: source: ${source}, cnt: ${cnt:-"-"}, cnt_srt: ${cnt_srt:-"-"}, cnt_tld: ${cnt_tld:-"-"}"
+       local cnt cnt_srt cnt_tld source="${1}" temp="${1}.tld"
+
+       cnt="$(wc -l 2>/dev/null < "${source}")"
+       awk 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${source}" > "${temp}"
+       if [ ${?} -eq 0 ]
+       then
+               sort -u "${temp}" > "${source}"
+               if [ ${?} -eq 0 ]
+               then
+                       cnt_srt="$(wc -l 2>/dev/null < "${source}")"
+                       awk '{if(NR==1){tld=$NF};while(getline){if($NF!~tld"\\."){print tld;tld=$NF}}print tld}' "${source}" > "${temp}"
+                       if [ ${?} -eq 0 ]
+                       then
+                               awk 'BEGIN{FS="."}{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "${temp}" > "${source}"
+                               if [ ${?} -eq 0 ]
+                               then
+                                       cnt_tld="$(wc -l 2>/dev/null < "${source}")"
+                               else
+                                       mv -f "${temp}" > "${source}"
+                               fi
+                       fi
+               else
+                       mv -f "${temp}" "${source}"
+               fi
+       fi
+       f_log "debug" "f_tld  ::: source: ${source}, cnt: ${cnt:-"-"}, cnt_srt: ${cnt_srt:-"-"}, cnt_tld: ${cnt_tld:-"-"}"
 }
 
 # blocklist hash compare
 #
 f_hash()
 {
-    local hash hash_rc=1
-
-    if [ -x "${adb_hashutil}" ] && [ -f "${adb_dnsdir}/${adb_dnsfile}" ]
-    then
-        hash="$(${adb_hashutil} "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null | awk '{print $1}')"
-        if [ -z "${adb_hashold}" ] && [ -n "${hash}" ]
-        then
-            adb_hashold="${hash}"
-        elif [ -z "${adb_hashnew}" ] && [ -n "${hash}" ]
-        then
-            adb_hashnew="${hash}"
-        fi
-        if [ -n "${adb_hashold}" ] && [ -n "${adb_hashnew}" ]
-        then
-            if [ "${adb_hashold}" = "${adb_hashnew}" ]
-            then
-                hash_rc=0
-            fi
-            adb_hashold=""
-            adb_hashnew=""
-        fi
-    fi
-    f_log "debug" "f_hash ::: hash_util: ${adb_hashutil}, hash: ${hash}, out_rc: ${hash_rc}"
-    return ${hash_rc}
+       local hash hash_rc=1
+
+       if [ -x "${adb_hashutil}" ] && [ -f "${adb_dnsdir}/${adb_dnsfile}" ]
+       then
+               hash="$(${adb_hashutil} "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null | awk '{print $1}')"
+               if [ -z "${adb_hashold}" ] && [ -n "${hash}" ]
+               then
+                       adb_hashold="${hash}"
+               elif [ -z "${adb_hashnew}" ] && [ -n "${hash}" ]
+               then
+                       adb_hashnew="${hash}"
+               fi
+               if [ -n "${adb_hashold}" ] && [ -n "${adb_hashnew}" ]
+               then
+                       if [ "${adb_hashold}" = "${adb_hashnew}" ]
+                       then
+                               hash_rc=0
+                       fi
+                       adb_hashold=""
+                       adb_hashnew=""
+               fi
+       fi
+       f_log "debug" "f_hash ::: hash_util: ${adb_hashutil}, hash: ${hash}, out_rc: ${hash_rc}"
+       return ${hash_rc}
 }
 
 # suspend/resume adblock processing
 #
 f_switch()
 {
-    local mode="${1}"
-
-    if [ ! -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "suspend" ]
-    then
-        f_hash
-        cat "${adb_dnsdir}/${adb_dnsfile}" > "${adb_dnsdir}/.${adb_dnsfile}"
-        printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
-        f_hash
-    elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "resume" ]
-    then
-        f_hash
-        cat "${adb_dnsdir}/.${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
-        > "${adb_dnsdir}/.${adb_dnsfile}"
-        f_hash
-    fi
-    if [ ${?} -eq 1 ]
-    then
-        f_temp
-        f_dnsup
-        f_jsnup "${mode}"
-        f_log "info" "${mode} adblock processing"
-        f_rmtemp
-        exit 0
-    fi
+       local mode="${1}"
+
+       if [ ! -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "suspend" ]
+       then
+               f_hash
+               cat "${adb_dnsdir}/${adb_dnsfile}" > "${adb_dnsdir}/.${adb_dnsfile}"
+               printf '%s\n' "${adb_dnsheader}" > "${adb_dnsdir}/${adb_dnsfile}"
+               f_hash
+       elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "resume" ]
+       then
+               f_hash
+               cat "${adb_dnsdir}/.${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
+               > "${adb_dnsdir}/.${adb_dnsfile}"
+               f_hash
+       fi
+       if [ ${?} -eq 1 ]
+       then
+               f_temp
+               f_dnsup
+               f_jsnup "${mode}"
+               f_log "info" "${mode} adblock processing"
+               f_rmtemp
+               exit 0
+       fi
 }
 
 # query blocklist for certain (sub-)domains
 #
 f_query()
 {
-    local search result prefix suffix field domain="${1}" tld="${1#*.}"
-
-    if [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
-    then
-        printf '%s\n' "::: invalid domain input, please submit a single domain, e.g. 'doubleclick.net'"
-    else
-        case "${adb_dns}" in
-            dnsmasq)
-                prefix=".*[\/\.]"
-                suffix="(\/)"
-                field=2
-            ;;
-            unbound)
-                prefix=".*[\"\.]"
-                suffix="(static)"
-                field=3
-            ;;
-            named)
-                prefix="[^\*].*[\.]"
-                suffix="( \.)"
-                field=1
-            ;;
-            kresd)
-                prefix="[^\*].*[\.]"
-                suffix="( \.)"
-                field=1
-            ;;
-            dnscrypt-proxy)
-                prefix=".*[\.]"
-                suffix=""
-                field=1
-            ;;
-        esac
-        while [ "${domain}" != "${tld}" ]
-        do
-            search="${domain//./\.}"
-            result="$(awk -F '/|\"| ' "/^($search|${prefix}+${search}.*${suffix}$)/{i++;{printf(\"  + %s\n\",\$${field})};if(i>9){printf(\"  + %s\n\",\"[...]\");exit}}" "${adb_dnsdir}/${adb_dnsfile}")"
-            printf '%s\n' "::: results for domain '${domain}'"
-            printf '%s\n' "${result:-"  - no match"}"
-            domain="${tld}"
-            tld="${domain#*.}"
-        done
-    fi
+       local search result prefix suffix field domain="${1}" tld="${1#*.}"
+
+       if [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
+       then
+               printf '%s\n' "::: invalid domain input, please submit a single domain, e.g. 'doubleclick.net'"
+       else
+               case "${adb_dns}" in
+                       dnsmasq)
+                               prefix=".*[\/\.]"
+                               suffix="(\/)"
+                               field=2
+                       ;;
+                       unbound)
+                               prefix=".*[\"\.]"
+                               suffix="(static)"
+                               field=3
+                       ;;
+                       named)
+                               prefix="[^\*].*[\.]"
+                               suffix="( \.)"
+                               field=1
+                       ;;
+                       kresd)
+                               prefix="[^\*].*[\.]"
+                               suffix="( \.)"
+                               field=1
+                       ;;
+                       dnscrypt-proxy)
+                               prefix=".*[\.]"
+                               suffix=""
+                               field=1
+                       ;;
+               esac
+               while [ "${domain}" != "${tld}" ]
+               do
+                       search="${domain//./\.}"
+                       result="$(awk -F '/|\"| ' "/^($search|${prefix}+${search}.*${suffix}$)/{i++;{printf(\"  + %s\n\",\$${field})};if(i>9){printf(\"  + %s\n\",\"[...]\");exit}}" "${adb_dnsdir}/${adb_dnsfile}")"
+                       printf '%s\n' "::: results for domain '${domain}'"
+                       printf '%s\n' "${result:-"  - no match"}"
+                       domain="${tld}"
+                       tld="${domain#*.}"
+               done
+       fi
 }
 
 # update runtime information
 #
 f_jsnup()
 {
-    local bg_pid rundate status="${1:-"enabled"}" mode="normal mode" no_mail=0
-
-    if [ ${adb_rc} -gt 0 ]
-    then
-        status="error"
-        rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
-    fi
-    if [ ${adb_enabled} -eq 0 ]
-    then
-        status="disabled"
-    fi
-    if [ "${status}" = "enabled" ]
-    then
-        rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
-    fi
-    if [ "${status}" = "suspend" ]
-    then
-        status="paused"
-    fi
-    if [ "${status}" = "resume" ]
-    then
-        no_mail=1
-        status="enabled"
-    fi
-    if [ ${adb_backup_mode} -eq 1 ]
-    then
-        mode="backup mode"
-    fi
-
-    if [ -s "${adb_rtfile}" ]
-    then
-        json_load "$(cat "${adb_rtfile}" 2>/dev/null)"
-        json_select data
-
-        if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ]
-        then
-            json_get_var adb_fetchinfo "fetch_utility"
-        fi
-        if [ -z "${rundate}" ]
-        then
-            json_get_var rundate "last_rundate"
-        fi
-        if [ -z "${adb_cnt}" ]
-        then
-            json_get_var adb_cnt "overall_domains"
-            adb_cnt="${adb_cnt%% *}"
-        fi
-    fi
-
-    json_init
-    json_add_object "data"
-    json_add_string "adblock_status" "${status}"
-    json_add_string "adblock_version" "${adb_ver}"
-    json_add_string "overall_domains" "${adb_cnt:-0} (${mode})"
-    json_add_string "fetch_utility" "${adb_fetchinfo:-"-"}"
-    json_add_string "dns_backend" "${adb_dns} (${adb_dnsdir})"
-    json_add_string "last_rundate" "${rundate:-"-"}"
-    json_add_string "system_release" "${adb_sysver}"
-    json_close_object
-    json_dump > "${adb_rtfile}"
-
-    if [ ${adb_notify} -eq 1 ] && [ ${no_mail} -eq 0 ] && [ -x /etc/adblock/adblock.notify ] && \
-      ([ "${status}" = "error" ] || ([ "${status}" = "enabled" ] && [ ${adb_cnt} -le ${adb_notifycnt} ]))
-    then
-        (/etc/adblock/adblock.notify >/dev/null 2>&1) &
-        bg_pid=${!}
-    fi
-    f_log "debug" "f_jsnup::: status: ${status}, mode: ${mode}, cnt: ${adb_cnt}, notify: ${adb_notify}, notify_cnt: ${adb_notifycnt}, notify_pid: ${bg_pid:-"-"}"
+       local run_time bg_pid status="${1:-"enabled"}" mode="normal mode" no_mail=0
+
+       if [ ${adb_rc} -gt 0 ]
+       then
+               status="error"
+               run_time="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+       fi
+       if [ "${status}" = "enabled" ]
+       then
+               run_time="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+       fi
+       if [ "${status}" = "suspend" ]
+       then
+               status="paused"
+       fi
+       if [ "${status}" = "resume" ]
+       then
+               no_mail=1
+               status="enabled"
+       fi
+       if [ ${adb_backup_mode} -eq 1 ]
+       then
+               mode="backup mode"
+       fi
+
+       if [ -z "${adb_fetchinfo}" ]
+       then
+               json_get_var adb_fetchinfo "fetch_utility"
+       fi
+       if [ -z "${adb_cnt}" ]
+       then
+               json_get_var adb_cnt "overall_domains"
+               adb_cnt="${adb_cnt%% *}"
+       fi
+       if [ -z "${run_time}" ]
+       then
+               json_get_var run_time "last_rundate"
+       fi
+       json_add_string "adblock_status" "${status}"
+       json_add_string "adblock_version" "${adb_ver}"
+       json_add_string "overall_domains" "${adb_cnt:-0} (${mode})"
+       json_add_string "fetch_utility" "${adb_fetchinfo:-"-"}"
+       json_add_string "dns_backend" "${adb_dns} (${adb_dnsdir})"
+       json_add_string "last_rundate" "${run_time:-"-"}"
+       json_add_string "system_release" "${adb_sysver}"
+       json_dump > "${adb_rtfile}"
+
+       if [ ${adb_notify} -eq 1 ] && [ ${no_mail} -eq 0 ] && [ -x /etc/adblock/adblock.notify ] && \
+               ([ "${status}" = "error" ] || ([ "${status}" = "enabled" ] && [ ${adb_cnt} -le ${adb_notifycnt} ]))
+       then
+               (/etc/adblock/adblock.notify >/dev/null 2>&1) &
+               bg_pid=${!}
+       fi
+       f_log "debug" "f_jsnup::: status: ${status}, mode: ${mode}, cnt: ${adb_cnt}, notify: ${adb_notify}, notify_cnt: ${adb_notifycnt}, notify_pid: ${bg_pid:-"-"}"
 }
 
 # write to syslog
 #
 f_log()
 {
-    local class="${1}" log_msg="${2}"
-
-    if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${adb_debug} -eq 1 ])
-    then
-        logger -p "${class}" -t "adblock-[${adb_ver}]" "${log_msg}"
-        if [ "${class}" = "err" ]
-        then
-            f_rmdns
-            f_jsnup
-            logger -p "${class}" -t "adblock-[${adb_ver}]" "Please also check 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'"
-            exit 1
-        fi
-    fi
+       local class="${1}" log_msg="${2}"
+
+       if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${adb_debug} -eq 1 ])
+       then
+               logger -p "${class}" -t "adblock-${adb_ver}[${$}]" "${log_msg}"
+               if [ "${class}" = "err" ]
+               then
+                       f_rmdns
+                       f_jsnup
+                       logger -p "${class}" -t "adblock-${adb_ver}[${$}]" "Please also check 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'"
+                       exit 1
+               fi
+       fi
 }
 
 # main function for blocklist processing
 #
 f_main()
 {
-    local tmp_load tmp_file src_name src_rset src_url src_log src_arc src_cat cat list entry suffix mem_total mem_free enabled cnt=1
-
-    mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
-    mem_free="$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
-    tmp_load="${adb_tmpload}"
-    tmp_file="${adb_tmpfile}"
-    > "${adb_dnsdir}/.${adb_dnsfile}"
-    > "${adb_tmpdir}/tmp.raw_whitelist"
-    > "${adb_tmpdir}/tmp.add_whitelist"
-    > "${adb_tmpdir}/tmp.rem_whitelist"
-    f_log "debug" "f_main ::: dns: ${adb_dns}, fetch_util: ${adb_fetchinfo}, backup: ${adb_backup}, backup_mode: ${adb_backup_mode}, dns_jail: ${adb_jail}, force_srt: ${adb_forcesrt}, force_dns: ${adb_forcedns}, mem_total: ${mem_total:-0}, mem_free: ${mem_free:-0}, max_queue: ${adb_maxqueue}"
-
-    # prepare whitelist entries
-    #
-    if [ -s "${adb_whitelist}" ]
-    then
-        adb_whitelist_rset="/^([^([:space:]|\#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}"
-        awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.raw_whitelist"
-        f_tld "${adb_tmpdir}/tmp.raw_whitelist"
-
-        adb_whitelist_rset="/^([^([:space:]|\#|\*|\/).]+\.)+[[:alpha:]]+([[:space:]]|$)/{gsub(\"\\\.\",\"\\\.\",\$1);print tolower(\"^\"\$1\"\\\|\\\.\"\$1)}"
-        awk "${adb_whitelist_rset}" "${adb_tmpdir}/tmp.raw_whitelist" > "${adb_tmpdir}/tmp.rem_whitelist"
-
-        if [ -n "${adb_dnsallow}" ]
-        then
-            eval "${adb_dnsallow}" "${adb_tmpdir}/tmp.raw_whitelist" > "${adb_tmpdir}/tmp.add_whitelist"
-        fi
-    fi
-
-    # build 'dnsjail' list
-    #
-    if [ ${adb_jail} -eq 1 ]
-    then
-        cat "${adb_tmpdir}/tmp.add_whitelist" > "/tmp/${adb_dnsjail}"
-        printf '%s\n' "${adb_dnshalt}" >> "/tmp/${adb_dnsjail}"
-        if [ -n "${adb_dnsheader}" ]
-        then
-            printf '%s\n' "${adb_dnsheader}" | cat - "/tmp/${adb_dnsjail}" > "${adb_tmpdir}/tmp.dnsjail"
-            cat "${adb_tmpdir}/tmp.dnsjail" > "/tmp/${adb_dnsjail}"
-        fi
-    fi
-
-    # main loop
-    #
-    for src_name in ${adb_sources}
-    do
-        enabled="$(eval printf '%s' \"\${enabled_${src_name}\}\")"
-        src_url="$(eval printf '%s' \"\${adb_src_${src_name}\}\")"
-        src_rset="$(eval printf '%s' \"\${adb_src_rset_${src_name}\}\")"
-        src_cat="$(eval printf '%s' \"\${adb_src_cat_${src_name}\}\")"
-        adb_tmpload="${tmp_load}.${src_name}"
-        adb_tmpfile="${tmp_file}.${src_name}"
-
-        # basic pre-checks
-        #
-        f_log "debug" "f_main ::: name: ${src_name}, enabled: ${enabled}"
-        if [ "${enabled}" != "1" ] || [ -z "${src_url}" ] || [ -z "${src_rset}" ]
-        then
-            f_list remove
-            continue
-        fi
-
-        # backup mode
-        #
-        if [ ${adb_backup_mode} -eq 1 ] && [ "${adb_action}" = "start" ] && [ "${src_name}" != "blacklist" ]
-        then
-            f_list restore
-            if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
-            then
-                if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
-                then
-                    f_tld "${adb_tmpfile}"
-                fi
-                continue
-            fi
-        fi
-
-        # download queue processing
-        #
-        if [ "${src_name}" = "blacklist" ]
-        then
-            if [ -s "${src_url}" ]
-            then
-                (
-                  src_log="$(cat "${src_url}" > "${adb_tmpload}" 2>&1)"
-                  adb_rc=${?}
-                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
-                  then
-                      awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
-                      adb_rc=${?}
-                      if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
-                      then
-                          rm -f "${adb_tmpload}"
-                          f_list download
-                          if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
-                          then
-                              f_tld "${adb_tmpfile}"
-                          fi
-                      fi
-                  else
-                      src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
-                      f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
-                  fi
-                ) &
-            else
-                continue
-            fi
-        elif [ -n "${src_cat}" ]
-        then
-            (
-              src_arc="${adb_tmpdir}/${src_url##*/}"
-              src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${src_arc}" "${src_url}" 2>&1)"
-              adb_rc=${?}
-              if [ ${adb_rc} -eq 0 ] && [ -s "${src_arc}" ]
-              then
-                  list="$(tar -tzf "${src_arc}")"
-                  suffix="$(eval printf '%s' \"\${adb_src_suffix_${src_name}:-\"domains\"\}\")"
-                  for cat in ${src_cat}
-                  do
-                      entry="$(printf '%s' "${list}" | grep -E "[\^/]+${cat}/${suffix}")"
-                      if [ -n "${entry}" ]
-                      then
-                          tar -xOzf "${src_arc}" "${entry}" >> "${adb_tmpload}"
-                          adb_rc=${?}
-                          if [ ${adb_rc} -ne 0 ]
-                          then
-                              break
-                          fi
-                      fi
-                  done
-              else
-                  src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
-                  f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
-              fi
-              if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
-              then
-                  rm -f "${src_arc}"
-                  awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
-                  adb_rc=${?}
-                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
-                  then
-                      rm -f "${adb_tmpload}"
-                      f_list download
-                      if [ ${adb_backup} -eq 1 ]
-                      then
-                          f_list backup
-                      fi
-                      if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
-                      then
-                          f_tld "${adb_tmpfile}"
-                      fi
-                  elif [ ${adb_backup} -eq 1 ]
-                  then
-                      f_list restore
-                  fi
-              elif [ ${adb_backup} -eq 1 ]
-              then
-                  f_list restore
-              fi
-            ) &
-        else
-            (
-              src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${adb_tmpload}" "${src_url}" 2>&1)"
-              adb_rc=${?}
-              if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
-              then
-                  awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
-                  adb_rc=${?}
-                  if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
-                  then
-                      rm -f "${adb_tmpload}"
-                      f_list download
-                      if [ ${adb_backup} -eq 1 ]
-                      then
-                          f_list backup
-                      fi
-                      if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
-                      then
-                          f_tld "${adb_tmpfile}"
-                      fi
-                  elif [ ${adb_backup} -eq 1 ]
-                  then
-                      f_list restore
-                  fi
-              else
-                  src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
-                  f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
-                  if [ ${adb_backup} -eq 1 ]
-                  then
-                      f_list restore
-                  fi
-              fi
-            ) &
-        fi
-        hold=$(( cnt % adb_maxqueue ))
-        if [ ${hold} -eq 0 ]
-        then
-            wait
-        fi
-        cnt=$(( cnt + 1 ))
-    done
-
-    # list merge
-    #
-    wait
-    src_name="overall"
-    adb_tmpfile="${tmp_file}"
-    f_list merge
-
-    # overall sort and conditional dns restart
-    #
-    f_hash
-    if [ -s "${adb_tmpdir}/${adb_dnsfile}" ]
-    then
-        if ([ ${mem_total} -ge 64 ] && [ ${mem_free} -ge 40 ]) || [ ${adb_forcesrt} -eq 1 ]
-        then
-            f_tld "${adb_tmpdir}/${adb_dnsfile}"
-        fi
-        f_list final
-    else
-        > "${adb_dnsdir}/${adb_dnsfile}"
-    fi
-    chown "${adb_dnsuser}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
-    f_hash
-    if [ ${?} -eq 1 ]
-    then
-        f_dnsup
-    fi
-    f_jsnup
-    if [ ${?} -eq 0 ]
-    then
-        f_log "info" "blocklist with overall ${adb_cnt} domains loaded successfully (${adb_sysver})"
-    else
-        f_log "err" "dns backend restart with active blocklist failed"
-    fi
-    f_rmtemp
-    exit ${adb_rc}
+       local tmp_load tmp_file src_name src_rset src_url src_log src_arc src_cat cat list entry suffix mem_total mem_free enabled cnt=1
+
+       mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
+       mem_free="$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo" 2>/dev/null)"
+       tmp_load="${adb_tmpload}"
+       tmp_file="${adb_tmpfile}"
+       > "${adb_dnsdir}/.${adb_dnsfile}"
+       > "${adb_tmpdir}/tmp.raw_whitelist"
+       > "${adb_tmpdir}/tmp.add_whitelist"
+       > "${adb_tmpdir}/tmp.rem_whitelist"
+       f_log "debug" "f_main ::: dns: ${adb_dns}, fetch_util: ${adb_fetchinfo}, backup: ${adb_backup}, backup_mode: ${adb_backup_mode}, dns_jail: ${adb_jail}, force_srt: ${adb_forcesrt}, force_dns: ${adb_forcedns}, mem_total: ${mem_total:-0}, mem_free: ${mem_free:-0}, max_queue: ${adb_maxqueue}"
+
+       # prepare whitelist entries
+       #
+       if [ -s "${adb_whitelist}" ]
+       then
+               adb_whitelist_rset="/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower(\$1)}"
+               awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.raw_whitelist"
+               f_tld "${adb_tmpdir}/tmp.raw_whitelist"
+
+               adb_whitelist_rset="/^([[:alnum:]_-]+\.)+[[:alpha:]]+([[:space:]]|$)/{gsub(\"\\\.\",\"\\\.\",\$1);print tolower(\"^\"\$1\"\\\|\\\.\"\$1)}"
+               awk "${adb_whitelist_rset}" "${adb_tmpdir}/tmp.raw_whitelist" > "${adb_tmpdir}/tmp.rem_whitelist"
+
+               if [ -n "${adb_dnsallow}" ]
+               then
+                       eval "${adb_dnsallow}" "${adb_tmpdir}/tmp.raw_whitelist" > "${adb_tmpdir}/tmp.add_whitelist"
+               fi
+       fi
+
+       # build 'dnsjail' list
+       #
+       if [ ${adb_jail} -eq 1 ]
+       then
+               cat "${adb_tmpdir}/tmp.add_whitelist" > "/tmp/${adb_dnsjail}"
+               printf '%s\n' "${adb_dnshalt}" >> "/tmp/${adb_dnsjail}"
+               if [ -n "${adb_dnsheader}" ]
+               then
+                       printf '%s\n' "${adb_dnsheader}" | cat - "/tmp/${adb_dnsjail}" > "${adb_tmpdir}/tmp.dnsjail"
+                       cat "${adb_tmpdir}/tmp.dnsjail" > "/tmp/${adb_dnsjail}"
+               fi
+       fi
+
+       # main loop
+       #
+       for src_name in ${adb_sources}
+       do
+               enabled="$(eval printf '%s' \"\${enabled_${src_name}\}\")"
+               src_url="$(eval printf '%s' \"\${adb_src_${src_name}\}\")"
+               src_rset="$(eval printf '%s' \"\${adb_src_rset_${src_name}\}\")"
+               src_cat="$(eval printf '%s' \"\${adb_src_cat_${src_name}\}\")"
+               adb_tmpload="${tmp_load}.${src_name}"
+               adb_tmpfile="${tmp_file}.${src_name}"
+
+               # basic pre-checks
+               #
+               f_log "debug" "f_main ::: name: ${src_name}, enabled: ${enabled}"
+               if [ "${enabled}" != "1" ] || [ -z "${src_url}" ] || [ -z "${src_rset}" ]
+               then
+                       f_list remove
+                       continue
+               fi
+
+               # backup mode
+               #
+               if [ ${adb_backup_mode} -eq 1 ] && [ "${adb_action}" = "start" ] && [ "${src_name}" != "blacklist" ]
+               then
+                       f_list restore
+                       if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                       then
+                               if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                               then
+                                       f_tld "${adb_tmpfile}"
+                               fi
+                               continue
+                       fi
+               fi
+
+               # download queue processing
+               #
+               if [ "${src_name}" = "blacklist" ]
+               then
+                       if [ -s "${src_url}" ]
+                       then
+                               (
+                                       src_log="$(cat "${src_url}" > "${adb_tmpload}" 2>&1)"
+                                       adb_rc=${?}
+                                       if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+                                       then
+                                               awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                                               adb_rc=${?}
+                                               if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                                               then
+                                                       rm -f "${adb_tmpload}"
+                                                       f_list download
+                                                       if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                                                       then
+                                                               f_tld "${adb_tmpfile}"
+                                                       fi
+                                               fi
+                                       else
+                                               src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                                               f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+                                       fi
+                               ) &
+                       else
+                               continue
+                       fi
+               elif [ -n "${src_cat}" ]
+               then
+                       (
+                               src_arc="${adb_tmpdir}/${src_url##*/}"
+                               src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${src_arc}" "${src_url}" 2>&1)"
+                               adb_rc=${?}
+                               if [ ${adb_rc} -eq 0 ] && [ -s "${src_arc}" ]
+                               then
+                                       list="$(tar -tzf "${src_arc}")"
+                                       suffix="$(eval printf '%s' \"\${adb_src_suffix_${src_name}:-\"domains\"\}\")"
+                                       for cat in ${src_cat}
+                                       do
+                                               entry="$(printf '%s' "${list}" | grep -E "[\^/]+${cat}/${suffix}")"
+                                               if [ -n "${entry}" ]
+                                               then
+                                                       tar -xOzf "${src_arc}" "${entry}" >> "${adb_tmpload}"
+                                                       adb_rc=${?}
+                                                       if [ ${adb_rc} -ne 0 ]
+                                                       then
+                                                               break
+                                                       fi
+                                               fi
+                                       done
+                               else
+                                       src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                                       f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+                               fi
+                               if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+                               then
+                                       rm -f "${src_arc}"
+                                       awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                                       adb_rc=${?}
+                                       if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                                       then
+                                               rm -f "${adb_tmpload}"
+                                               f_list download
+                                               if [ ${adb_backup} -eq 1 ]
+                                               then
+                                                       f_list backup
+                                               fi
+                                               if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                                               then
+                                                       f_tld "${adb_tmpfile}"
+                                               fi
+                                       elif [ ${adb_backup} -eq 1 ]
+                                       then
+                                               f_list restore
+                                       fi
+                               elif [ ${adb_backup} -eq 1 ]
+                               then
+                                       f_list restore
+                               fi
+                       ) &
+               else
+                       (
+                               src_log="$("${adb_fetchutil}" ${adb_fetchparm} "${adb_tmpload}" "${src_url}" 2>&1)"
+                               adb_rc=${?}
+                               if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
+                               then
+                                       awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
+                                       adb_rc=${?}
+                                       if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+                                       then
+                                               rm -f "${adb_tmpload}"
+                                               f_list download
+                                               if [ ${adb_backup} -eq 1 ]
+                                               then
+                                                       f_list backup
+                                               fi
+                                               if ([ ${mem_total} -lt 64 ] || [ ${mem_free} -lt 40 ]) && [ ${adb_forcesrt} -eq 0 ]
+                                               then
+                                                       f_tld "${adb_tmpfile}"
+                                               fi
+                                       elif [ ${adb_backup} -eq 1 ]
+                                       then
+                                               f_list restore
+                                       fi
+                               else
+                                       src_log="$(printf '%s' "${src_log}" | awk '{ORS=" ";print $0}')"
+                                       f_log "debug" "f_main ::: name: ${src_name}, url: ${src_url}, rc: ${adb_rc}, log: ${src_log:-"-"}"
+                                       if [ ${adb_backup} -eq 1 ]
+                                       then
+                                               f_list restore
+                                       fi
+                               fi
+                       ) &
+               fi
+               hold=$(( cnt % adb_maxqueue ))
+               if [ ${hold} -eq 0 ]
+               then
+                       wait
+               fi
+               cnt=$(( cnt + 1 ))
+       done
+
+       # list merge
+       #
+       wait
+       src_name="overall"
+       adb_tmpfile="${tmp_file}"
+       f_list merge
+
+       # overall sort and conditional dns restart
+       #
+       f_hash
+       if [ -s "${adb_tmpdir}/${adb_dnsfile}" ]
+       then
+               if ([ ${mem_total} -ge 64 ] && [ ${mem_free} -ge 40 ]) || [ ${adb_forcesrt} -eq 1 ]
+               then
+                       f_tld "${adb_tmpdir}/${adb_dnsfile}"
+               fi
+               f_list final
+       else
+               > "${adb_dnsdir}/${adb_dnsfile}"
+       fi
+       chown "${adb_dnsuser}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
+       f_hash
+       if [ ${?} -eq 1 ]
+       then
+               f_dnsup
+       fi
+       f_jsnup
+       if [ ${?} -eq 0 ]
+       then
+               f_log "info" "blocklist with overall ${adb_cnt} domains loaded successfully (${adb_sysver})"
+       else
+               f_log "err" "dns backend restart with active blocklist failed"
+       fi
+       f_rmtemp
+       exit ${adb_rc}
 }
 
+# source required system libraries
+#
+if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
+then
+       . "/lib/functions.sh"
+       . "/usr/share/libubox/jshn.sh"
+else
+       f_log "err" "system libraries not found"
+fi
+
+# initialize json runtime file
+#
+json_load_file "${adb_rtfile}" >/dev/null 2>&1
+json_select data >/dev/null 2>&1
+if [ ${?} -ne 0 ]
+then
+       > "${adb_rtfile}"
+       json_init
+       json_add_object "data"
+fi
+
 # handle different adblock actions
 #
 f_envload
 case "${adb_action}" in
-    stop)
-        f_rmdns
-    ;;
-    restart)
-        f_rmdns
-        f_envcheck
-        f_main
-    ;;
-    suspend)
-        f_switch suspend
-    ;;
-    resume)
-        f_switch resume
-    ;;
-    query)
-        f_query "${2}"
-    ;;
-    start|reload)
-        f_envcheck
-        f_main
-    ;;
+       stop)
+               f_rmdns
+       ;;
+       restart)
+               f_rmdns
+               f_envcheck
+               f_main
+       ;;
+       suspend)
+               f_switch suspend
+       ;;
+       resume)
+               f_switch resume
+       ;;
+       query)
+               f_query "${2}"
+       ;;
+       start|reload)
+               f_envcheck
+               f_main
+       ;;
 esac
index c6d56a170cc70515bc2f803e01e22b5db84a90c0..d63c030e6758f4714c9414fc071fc6624f15d868 100755 (executable)
@@ -252,6 +252,8 @@ aria2_start() {
        if [ ."$check_certificate" = ."true" ]; then
                append_setting "check-certificate=true"
                append_options "ca_certificate"
+       elif [ ."$check_certificate" = ."false" ]; then
+               append_setting "check-certificate=false"
        fi
 
        if [ ."$enable_dht" = ."true" ]; then
index bfe8862b2f51d9e0cb38333ddb7c9aada30005fb..a9762e09bef0ac512bf63bf72d1d9da85a5ce61c 100644 (file)
@@ -2,7 +2,8 @@
 
 
 if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; then
-       if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'server_name  localhost;')" ]; then
+       if [ "$( grep 'server_name  localhost;' < /etc/nginx/nginx.conf)" ] && 
+       [ ! "$( grep 'include ariang.conf;' < /etc/nginx/nginx.conf)" ]; then
                sed -i '/server_name  localhost;/a \\t\tinclude ariang.conf;' /etc/nginx/nginx.conf
                if [ -f /var/run/nginx.pid ]; then
                        /etc/init.d/nginx restart
@@ -11,3 +12,4 @@ if [ -f "/etc/nginx/nginx.conf" ] && [ -f "/etc/nginx/ariang.conf" ]; then
 fi
 
 exit 0
+
index 4bfdb0a00460a1bd2a1d79de6d9f375889729da0..c6cc67c94d60aa8e4cda9067a40ac57179f4ddc9 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=chrony
-PKG_VERSION:=3.3
-PKG_RELEASE:=2
+PKG_VERSION:=3.4
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://download.tuxfamily.org/chrony/
-PKG_HASH:=0d1fb2d5875032f2d5a86f3770374c87ee4c941916f64171e81f7684f2a73128
+PKG_HASH:=af77e47c2610a7e55c8af5b89a8aeff52d9a867dd5983d848b52d374bc0e6b9f
 
 PKG_MAINTAINER:=Miroslav Lichvar <mlichvar0@gmail.com>
 PKG_LICENSE:=GPL-2.0
index f7aee0a6a25178e292ead2b9d61faed43f508c56..492f755ff1d5073cadbc80788eb6eb5838c26b41 100644 (file)
@@ -36,8 +36,8 @@ handle_allow() {
        elif [ "$wan6_iface" = "$iface" ]; then
                echo allow ::/0
        else
-               network_get_subnets subnets $iface || \
-                       network_get_subnets subnets6 $iface || continue
+               network_get_subnets subnets $iface
+               network_get_subnets6 subnets6 $iface
                for subnet in $subnets $subnets6; do
                        echo allow $subnet
                done
diff --git a/net/chrony/patches/002-undefined_MIN.patch b/net/chrony/patches/002-undefined_MIN.patch
new file mode 100644 (file)
index 0000000..9381b8d
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/hash_intmd5.c
++++ b/hash_intmd5.c
+@@ -29,6 +29,7 @@
+ #include "sysincl.h"
+ #include "hash.h"
+ #include "memory.h"
++#include "util.h"
+ #include "md5.c"
index b54649198a449eaf22028c2e774f3e8c9dc2c402..daa84010189112261dd6f6c134c4269c85b03968 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=clamav
 PKG_VERSION:=0.100.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr> \
@@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk
 
 define Package/clamav/Default
   SECTION:=net
-  DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libjson-c +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
+  DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libjson-c +libmilter-sendmail +libopenssl +libltdl +libpcre2 +USE_MUSL:musl-fts
   CATEGORY:=Network
   SUBMENU:=Web Servers/Proxies
   TITLE:=ClamAV
@@ -66,6 +66,7 @@ define Build/Configure
                --sysconfdir=/etc/clamav/ \
                --prefix=/usr/ \
                --exec-prefix=/usr/ \
+               --enable-milter \
                --disable-xml \
                --disable-bzip2 \
                --with-user nobody \
@@ -87,6 +88,7 @@ endef
 define Package/clamav/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamd $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/clamav-milter $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamav-config $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clambc $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/clamconf $(1)/usr/sbin/
index f8d449b2d66d8d13a590dbdf27cd17944bf8d6d9..a4b67d9b1c93745a8cdad0a6b85eb8d8ca8a0089 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cshark
-PKG_VERSION=2015-11-24-$(PKG_SOURCE_VERSION)
-PKG_RELEASE=3
+PKG_VERSION=2018-08-20-$(PKG_SOURCE_VERSION)
+PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/cloudshark/cshark.git
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=e575ab3d35d75a6f70488001fcba45690ebe9b3e
+PKG_SOURCE_VERSION:=7a7cf7f35074b85c6fb0c52067e640d2433ef73b
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MIRROR_HASH:=280d2711308a5b051a43788519ae6857394690d3155fe954388c43cd9035ec84
+PKG_MIRROR_HASH:=bc448bb4e910e771a5a8a39af7cfa09a79b59c595f15cdcae9d0103ce09be019
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
index 2cd899e9933818bc33dc82a03b5ef777418e61ad..d72cab2607dc025241f45c3b9bcaa377ffdce82c 100755 (executable)
@@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.7.8
 # Release == build
 # increase on changes of services files or tld_names.dat
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=
index 28d048b72781cdbe6b923ca9be9d1736762f4606..31b6f1974e92c292d7ff05490cdc781875be5c48 100755 (executable)
@@ -21,7 +21,7 @@
 . /lib/functions/network.sh
 
 # GLOBAL VARIABLES #
-VERSION="2.7.8-3"
+VERSION="2.7.8-4"
 SECTION_ID=""          # hold config's section name
 VERBOSE=0              # default mode is log to console, but easily changed with parameter
 MYPROG=$(basename $0)  # my program call name
@@ -928,7 +928,7 @@ get_local_ip () {
        write_log 7 "Detect local IP on '$ip_source'"
 
        while : ; do
-               if [ -n "$ip_network" ]; then
+               if [ -n "$ip_network" -a "$ip_source" = "network" ]; then
                        # set correct program
                        network_flush_cache     # force re-read data from ubus
                        [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
@@ -936,7 +936,7 @@ get_local_ip () {
                        eval "$__RUNPROG __DATA $ip_network" || \
                                write_log 13 "Can not detect local IP using $__RUNPROG '$ip_network' - Error: '$?'"
                        [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'"
-               elif [ -n "$ip_interface" ]; then
+               elif [ -n "$ip_interface" -a "$ip_source" = "interface" ]; then
                        local __DATA4=""; local __DATA6=""
                        if [ -n "$(which ip)" ]; then           # ip program installed
                                write_log 7 "#> ip -o addr show dev $ip_interface scope global >$DATFILE 2>$ERRFILE"
@@ -1015,7 +1015,7 @@ get_local_ip () {
                        fi
                        [ $use_ipv6 -eq 0 ] && __DATA="$__DATA4" || __DATA="$__DATA6"
                        [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'"
-               elif [ -n "$ip_script" ]; then
+               elif [ -n "$ip_script" -a "$ip_source" = "script" ]; then
                        write_log 7 "#> $ip_script >$DATFILE 2>$ERRFILE"
                        eval $ip_script >$DATFILE 2>$ERRFILE
                        __ERR=$?
@@ -1026,7 +1026,7 @@ get_local_ip () {
                                write_log 3 "$ip_script Error: '$__ERR'"
                                write_log 7 "$(cat $ERRFILE)"           # report error
                        fi
-               elif [ -n "$ip_url" ]; then
+               elif [ -n "$ip_url" -a "$ip_source" = "web" ]; then
                        do_transfer "$ip_url"
                        # use correct regular expression
                        [ $use_ipv6 -eq 0 ] \
index 84dfdeb40756645e0e2e8285ebcfd19fbe2b4f04..76671b3cbadbcaad43b3d93744b9b5210ede0c57 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dmapd
-PKG_VERSION:=0.0.76
+PKG_VERSION:=0.0.77
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.flyn.org/projects/dmapd
-PKG_HASH:=f9fcd690ac4c3c80544713c1d82daa065022f230f1f4bf7a993f2f851ee2641d
+PKG_HASH:=2ffadffaba3bf680ade3ab851132a1b0d596f7a9dd9cdc7fc8bfbabacc7fab8d
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=2
index 82fcb70c32794b50f8a2ef8273415fb0caf854f6..d159ffd2c6b38aa1b9a00c96e84a6d981cb0c3c5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2015-2016 Thomas Weißschuh
+# Copyright (C) 2015-2018 Thomas Weißschuh
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=esniper
-PKG_VERSION:=2.33.0
+PKG_VERSION:=2.35.0
 PKG_RELEASE:=1
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
@@ -19,7 +19,7 @@ VERSION_TRANSFORMED:=$(subst .,-,$(PKG_VERSION))
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(VERSION_TRANSFORMED)
 PKG_SOURCE:=$(PKG_NAME)-$(VERSION_TRANSFORMED).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_HASH:=c9b8b10aefe5c397d7dee4c569f87f227c6710de528b1dc402379e5b4f1793dd
+PKG_HASH:=a93d4533e31640554f2e430ac76b43e73a50ed6d721511066020712ac8923c12
 
 PKG_BUILD_PARALLEL:=1
 
index bbc5643083975cb1b3036f671c7209aaab2cbb00..4350c35cc71c84d0589ce7468727e283498956eb 100644 (file)
@@ -8,21 +8,21 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fwknop
-PKG_VERSION:=2.6.9
-PKG_RELEASE:=5
+PKG_VERSION:=2.6.10
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
-PKG_HASH:=5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4
+PKG_SOURCE_URL:=https://www.cipherdyne.org/fwknop/download
+PKG_HASH:=f6c09bec97ed8e474a98ae14f9f53e1bcdda33393f20667b6af3fb6bb894ca77
 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
-PKG_LICENSE:=GPLv2
+PKG_LICENSE:=GPLv2+
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/fwknop/Default
   TITLE:=FireWall KNock OPerator
-  URL:=http://www.cipherdyne.org/fwknop/
+  URL:=https://www.cipherdyne.org/fwknop/
 endef
 
 define Package/fwknop/Default/description
index 961978f6ff4b403f20ca1ee5e954694b807068ae..9ab190891490a1e36fc3e9ecf74898749689f38e 100644 (file)
@@ -11,12 +11,12 @@ PKG_LICENSE:=ASL-2.0
 PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
 
 PKG_NAME:=go-ethereum
-PKG_VERSION:=1.8.13
+PKG_VERSION:=1.8.15
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ethereum/go-ethereum/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=c0c211172c1bc80855d19387300321fe233708bf8af1e4839ccf3b7de447bfb1
+PKG_HASH:=5081f21ab53f7eb9b84dbed32c4b58bb1c59a61163a6efaa0e4a8de764177c62
 
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
index 32e4121628c8a9088b0607735707e9af01c1d216..52779943c6d8b9ff12089d24469d495fe5183eb4 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=git
-PKG_VERSION:=2.18.0
-PKG_RELEASE:=1
+PKG_VERSION:=2.19.0
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_HASH:=8b40be383a603147ae29337136c00d1c634bdfdc169a30924a024596a7e30e92
+PKG_HASH:=180feff58fc0d965d23ea010aa2c69ead92ec318eb9b09cf737529aec62f3ef4
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
@@ -44,7 +44,7 @@ endef
 
 define Package/git-http
 $(call Package/git/Default)
-  DEPENDS+= +git +libcurl +ca-certificates
+  DEPENDS+= +git +libcurl
   TITLE:=Git HTTP commands
 endef
 
@@ -106,14 +106,11 @@ define Build/Compile
 endef
 
 define Package/git/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/git $(1)/usr/bin
        $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-cvsserver
+       $(RM) $(PKG_INSTALL_DIR)/usr/bin/git-shell
+       $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/git-* $(1)/usr/bin
        $(INSTALL_DIR) $(1)/usr/lib/git-core
-       ln $(1)/usr/bin/git $(1)/usr/lib/git-core/git
-       ln $(1)/usr/bin/git-shell $(1)/usr/lib/git-core/git-shell
-       ln $(1)/usr/bin/git-upload-pack $(1)/usr/lib/git-core/git-upload-pack
        $(INSTALL_DIR) $(1)/usr/share/git-core/templates
        ( cd $(PKG_INSTALL_DIR); $(TAR) \
                --exclude=usr/lib/git-core/git-http-backend \
@@ -122,13 +119,12 @@ define Package/git/install
                --exclude=usr/lib/git-core/git-remote-ftps \
                --exclude=usr/lib/git-core/git-remote-http \
                --exclude=usr/lib/git-core/git-remote-https \
-               --exclude=usr/lib/git-core/git \
-               --exclude=usr/lib/git-core/git-shell \
-               --exclude=usr/lib/git-core/git-upload-pack \
                -cf - \
                usr/lib/git-core \
                usr/share/git-core/templates \
        ) | ( cd $(1); $(TAR) -xf - )
+       ln $(1)/usr/lib/git-core/git $(1)/usr/bin/git
+       ln $(1)/usr/lib/git-core/git-shell $(1)/usr/bin/git-shell
 endef
 
 define Package/git-http/install
index 7a90da2400b280ef93771abb707bb24423cb4a57..2c186650458afdc132a22b211cfec087d230d342 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
 PKG_VERSION:=1.8.13
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.haproxy.org/download/1.8/src/
diff --git a/net/haproxy/patches/0000-BUG-MEDIUM-servers-check-the-queues-once-enabling-a-server.patch b/net/haproxy/patches/0000-BUG-MEDIUM-servers-check-the-queues-once-enabling-a-server.patch
new file mode 100644 (file)
index 0000000..ba5c022
--- /dev/null
@@ -0,0 +1,46 @@
+commit ef9b56022c656df34044103a317b7b890ced6628
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Tue Aug 7 10:14:53 2018 +0200
+
+    BUG/MEDIUM: servers: check the queues once enabling a server
+    
+    Commit 64cc49c ("MAJOR: servers: propagate server status changes
+    asynchronously.") heavily changed the way the server states are
+    updated since they became asynchronous. During this change, some
+    code was lost, which is used to shut down some sessions from a
+    backup server and to pick pending connections from a proxy once
+    a server is turned back from maintenance to ready state. The
+    effect is that when temporarily disabling a server, connections
+    stay in the backend's queue, and when re-enabling it, they are
+    not picked and they expire in the backend's queue. Now they're
+    properly picked again.
+    
+    This fix must be backported to 1.8.
+    
+    (cherry picked from commit 6a78e61694d69beb49c0e8486be9550f5e8b7d08)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/server.c b/src/server.c
+index 3d6a4093..fbed6cd4 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -4774,6 +4774,19 @@ void srv_update_status(struct server *s)
+               if (prev_srv_count && s->proxy->srv_bck == 0 && s->proxy->srv_act == 0)
+                       set_backend_down(s->proxy);
++              /* If the server is set with "on-marked-up shutdown-backup-sessions",
++               * and it's not a backup server and its effective weight is > 0,
++               * then it can accept new connections, so we shut down all streams
++               * on all backup servers.
++               */
++              if ((s->onmarkedup & HANA_ONMARKEDUP_SHUTDOWNBACKUPSESSIONS) &&
++                  !(s->flags & SRV_F_BACKUP) && s->next_eweight)
++                      srv_shutdown_backup_streams(s->proxy, SF_ERR_UP);
++
++              /* check if we can handle some connections queued at the proxy. We
++               * will take as many as we can handle.
++               */
++              xferred = pendconn_grab_from_px(s);
+       }
+       else if (s->next_admin & SRV_ADMF_MAINT) {
+               /* remaining in maintenance mode, let's inform precisely about the
diff --git a/net/haproxy/patches/0001-BUG-MEDIUM-queue-prevent-a-backup-server-from-draining-the-proxys-connections.patch b/net/haproxy/patches/0001-BUG-MEDIUM-queue-prevent-a-backup-server-from-draining-the-proxys-connections.patch
new file mode 100644 (file)
index 0000000..54d3b8c
--- /dev/null
@@ -0,0 +1,52 @@
+commit 5550143cd6de58c6e733e389c6946e3dd26e89c0
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Tue Aug 7 10:44:58 2018 +0200
+
+    BUG/MEDIUM: queue: prevent a backup server from draining the proxy's connections
+    
+    When switching back from a backup to an active server, the backup server
+    currently continues to drain the proxy's connections, which is a problem
+    because it's not expected to be able to pick them.
+    
+    This patch ensures that a backup server will only pick backend connections
+    if there is no active server and it is the selected backup server or all
+    backup servers are supposed to be used.
+    
+    This issue seems to have existed forever, so this fix should be backported
+    to all stable versions.
+    
+    (cherry picked from commit a8694654ba021bf1e0e560a98ab5e70dc44d212e)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/queue.c b/src/queue.c
+index 1c730c75..b0b89426 100644
+--- a/src/queue.c
++++ b/src/queue.c
+@@ -117,7 +117,10 @@ static int pendconn_process_next_strm(struct server *srv, struct proxy *px)
+       }
+   ps_found:
+-      if (srv_currently_usable(rsrv) && px->nbpend) {
++      if (srv_currently_usable(rsrv) && px->nbpend &&
++          (!(srv->flags & SRV_F_BACKUP) ||
++           (!px->srv_act &&
++            (srv == px->lbprm.fbck || (px->options & PR_O_USE_ALL_BK))))) {
+               struct pendconn *pp;
+               list_for_each_entry(pp, &px->pendconns, list) {
+@@ -287,6 +290,15 @@ int pendconn_grab_from_px(struct server *s)
+       if (!srv_currently_usable(s))
+               return 0;
++      /* if this is a backup server and there are active servers or at
++       * least another backup server was elected, then this one must
++       * not dequeue requests from the proxy.
++       */
++      if ((s->flags & SRV_F_BACKUP) &&
++          (s->proxy->srv_act ||
++           ((s != s->proxy->lbprm.fbck) && !(s->proxy->options & PR_O_USE_ALL_BK))))
++              return 0;
++
+       HA_SPIN_LOCK(PROXY_LOCK, &s->proxy->lock);
+       maxconn = srv_dynamic_maxconn(s);
+       list_for_each_entry_safe(p, pback, &s->proxy->pendconns, list) {
diff --git a/net/haproxy/patches/0002-MINOR-dns-fix-wrong-score-computation-in-dns_get_ip_from_response.patch b/net/haproxy/patches/0002-MINOR-dns-fix-wrong-score-computation-in-dns_get_ip_from_response.patch
new file mode 100644 (file)
index 0000000..aacb7f0
--- /dev/null
@@ -0,0 +1,43 @@
+commit 7d395954136c45e1533f355068399fec5e606db1
+Author: Baptiste Assmann <bedis9@gmail.com>
+Date:   Fri Jun 22 13:03:50 2018 +0200
+
+    MINOR: dns: fix wrong score computation in dns_get_ip_from_response
+    
+    dns_get_ip_from_response() is used to compare the caller current IP to
+    the IP available in the records returned by the DNS server.
+    A scoring system is in place to get the best IP address available.
+    That said, in the current implementation, there are a couple of issues:
+    1. a comment does not match what the code does
+    2. the code does not match what the commet says (score value is not
+       incremented with '2')
+    
+    This patch fixes both issues.
+    
+    Backport status: 1.8
+    
+    (cherry picked from commit 84221b4e9010810cf93b7ad7a31d825fa9fc26bf)
+    [wt: Baptiste explicitly asked for this one to be backported to stable]
+    Cc: Baptiste <bedis9@gmail.com>
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/dns.c b/src/dns.c
+index 153a46b2..d8388ef1 100644
+--- a/src/dns.c
++++ b/src/dns.c
+@@ -1027,10 +1027,13 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p,
+               }
+               /* Check if the IP found in the record is already affected to a
+-               * member of a group.  If yes, the score should be incremented
++               * member of a group.  If not, the score should be incremented
+                * by 2. */
+-              if (owner && snr_check_ip_callback(owner, ip, &ip_type))
++              if (owner && snr_check_ip_callback(owner, ip, &ip_type)) {
+                       continue;
++              } else {
++                      score += 2;
++              }
+               /* Check for current ip matching. */
+               if (ip_type == currentip_sin_family &&
diff --git a/net/haproxy/patches/0003-MINOR-dns-new-DNS-options-to-allow-prevent-IP-address-duplication.patch b/net/haproxy/patches/0003-MINOR-dns-new-DNS-options-to-allow-prevent-IP-address-duplication.patch
new file mode 100644 (file)
index 0000000..e824bb0
--- /dev/null
@@ -0,0 +1,158 @@
+commit c1bfcd002f54d1d84a99282d13f875c2649f3d70
+Author: Baptiste Assmann <bedis9@gmail.com>
+Date:   Fri Jun 22 15:04:43 2018 +0200
+
+    MINOR: dns: new DNS options to allow/prevent IP address duplication
+    
+    By default, HAProxy's DNS resolution at runtime ensure that there is no
+    IP address duplication in a backend (for servers being resolved by the
+    same hostname).
+    There are a few cases where people want, on purpose, to disable this
+    feature.
+    
+    This patch introduces a couple of new server side options for this purpose:
+    "resolve-opts allow-dup-ip" or "resolve-opts prevent-dup-ip".
+    
+    (cherry picked from commit 8e2d9430c0562ed74276d7f58e92706c384c0a36)
+    
+    [wt: this is backported to 1.8 upon request from Baptiste because it offers
+     the option to revert to 1.7 behaviour, which some people depend on. The
+     address deduplication used on 1.8 apparently is not suited to everyone]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/doc/configuration.txt b/doc/configuration.txt
+index 011533a0..1973bbf2 100644
+--- a/doc/configuration.txt
++++ b/doc/configuration.txt
+@@ -11623,6 +11623,40 @@ rise <count>
+   after <count> consecutive successful health checks. This value defaults to 2
+   if unspecified. See also the "check", "inter" and "fall" parameters.
++resolve-opts <option>,<option>,...
++  Comma separated list of options to apply to DNS resolution linked to this
++  server.
++
++  Available options:
++
++  * allow-dup-ip
++    By default, HAProxy prevents IP address duplication in a backend when DNS
++    resolution at runtime is in operation.
++    That said, for some cases, it makes sense that two servers (in the same
++    backend, being resolved by the same FQDN) have the same IP address.
++    For such case, simply enable this option.
++    This is the opposite of prevent-dup-ip.
++
++  * prevent-dup-ip
++    Ensure HAProxy's default behavior is enforced on a server: prevent re-using
++    an IP address already set to a server in the same backend and sharing the
++    same fqdn.
++    This is the opposite of allow-dup-ip.
++
++  Example:
++    backend b_myapp
++      default-server init-addr none resolvers dns
++      server s1 myapp.example.com:80 check resolve-opts allow-dup-ip
++      server s2 myapp.example.com:81 check resolve-opts allow-dup-ip
++
++  With the option allow-dup-ip set:
++  * if the nameserver returns a single IP address, then both servers will use
++    it
++  * If the nameserver returns 2 IP addresses, then each server will pick up a
++    different address
++
++  Default value: not set
++
+ resolve-prefer <family>
+   When DNS resolution is enabled for a server and multiple IP addresses from
+   different families are returned, HAProxy will prefer using an IP address
+diff --git a/include/types/dns.h b/include/types/dns.h
+index 9b1d08df..488d3996 100644
+--- a/include/types/dns.h
++++ b/include/types/dns.h
+@@ -245,6 +245,8 @@ struct dns_options {
+               } mask;
+       } pref_net[SRV_MAX_PREF_NET];
+       int pref_net_nb; /* The number of registered prefered networks. */
++      int accept_duplicate_ip; /* flag to indicate whether the associated object can use an IP address
++                                  already set to an other object of the same group */
+ };
+ /* Resolution structure associated to single server and used to manage name
+diff --git a/src/dns.c b/src/dns.c
+index d8388ef1..b31000a2 100644
+--- a/src/dns.c
++++ b/src/dns.c
+@@ -965,8 +965,10 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p,
+       int currentip_sel;
+       int j;
+       int score, max_score;
++      int allowed_duplicated_ip;
+       family_priority   = dns_opts->family_prio;
++      allowed_duplicated_ip = dns_opts->accept_duplicate_ip;
+       *newip = newip4   = newip6 = NULL;
+       currentip_found   = 0;
+       *newip_sin_family = AF_UNSPEC;
+@@ -1030,7 +1032,9 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p,
+                * member of a group.  If not, the score should be incremented
+                * by 2. */
+               if (owner && snr_check_ip_callback(owner, ip, &ip_type)) {
+-                      continue;
++                      if (!allowed_duplicated_ip) {
++                              continue;
++                      }
+               } else {
+                       score += 2;
+               }
+diff --git a/src/server.c b/src/server.c
+index fbed6cd4..36a05e27 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -1506,6 +1506,7 @@ static void srv_settings_cpy(struct server *srv, struct server *src, int srv_tmp
+       if (src->resolvers_id != NULL)
+               srv->resolvers_id = strdup(src->resolvers_id);
+       srv->dns_opts.family_prio = src->dns_opts.family_prio;
++      srv->dns_opts.accept_duplicate_ip = src->dns_opts.accept_duplicate_ip;
+       if (srv->dns_opts.family_prio == AF_UNSPEC)
+               srv->dns_opts.family_prio = AF_INET6;
+       memcpy(srv->dns_opts.pref_net,
+@@ -2044,6 +2045,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
+                       newsrv = &curproxy->defsrv;
+                       cur_arg = 1;
+                       newsrv->dns_opts.family_prio = AF_INET6;
++                      newsrv->dns_opts.accept_duplicate_ip = 0;
+               }
+               while (*args[cur_arg]) {
+@@ -2139,6 +2141,31 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
+                               newsrv->resolvers_id = strdup(args[cur_arg + 1]);
+                               cur_arg += 2;
+                       }
++                      else if (!strcmp(args[cur_arg], "resolve-opts")) {
++                              char *p, *end;
++
++                              for (p = args[cur_arg + 1]; *p; p = end) {
++                                      /* cut on next comma */
++                                      for (end = p; *end && *end != ','; end++);
++                                      if (*end)
++                                              *(end++) = 0;
++
++                                      if (!strcmp(p, "allow-dup-ip")) {
++                                              newsrv->dns_opts.accept_duplicate_ip = 1;
++                                      }
++                                      else if (!strcmp(p, "prevent-dup-ip")) {
++                                              newsrv->dns_opts.accept_duplicate_ip = 0;
++                                      }
++                                      else {
++                                              ha_alert("parsing [%s:%d]: '%s' : unknown resolve-opts option '%s', supported methods are 'allow-dup-ip' and 'prevent-dup-ip'.\n",
++                                                              file, linenum, args[cur_arg], p);
++                                              err_code |= ERR_ALERT | ERR_FATAL;
++                                              goto out;
++                                      }
++                              }
++
++                              cur_arg += 2;
++                      }
+                       else if (!strcmp(args[cur_arg], "resolve-prefer")) {
+                               if (!strcmp(args[cur_arg + 1], "ipv4"))
+                                       newsrv->dns_opts.family_prio = AF_INET;
diff --git a/net/haproxy/patches/0004-BUG-MEDIUM-lua-possible-CLOSE-WAIT-state-with-n-headers.patch b/net/haproxy/patches/0004-BUG-MEDIUM-lua-possible-CLOSE-WAIT-state-with-n-headers.patch
new file mode 100644 (file)
index 0000000..09c765e
--- /dev/null
@@ -0,0 +1,72 @@
+commit d804e5e6b76bfd34576305ff33fe32aacb1fa5b7
+Author: Thierry FOURNIER <thierry.fournier@ozon.io>
+Date:   Sat Jun 30 10:37:33 2018 +0200
+
+    BUG/MEDIUM: lua: possible CLOSE-WAIT state with '\n' headers
+    
+    The Lua parser doesn't takes in account end-of-headers containing
+    only '\n'. It expects always '\r\n'. If a '\n' is processes the Lua
+    parser considers it miss 1 byte, and wait indefinitely for new data.
+    
+    When the client reaches their timeout, it closes the connection.
+    This close is not detected and the connection keep in CLOSE-WAIT
+    state.
+    
+    I guess that this patch fix only a visible part of the problem.
+    If the Lua HTTP parser wait for data, the timeout server or the
+    connectio closed by the client may stop the applet.
+    
+    How reproduce the problem:
+    
+    HAProxy conf:
+    
+       global
+          lua-load bug38.lua
+       frontend frt
+          timeout client 2s
+          timeout server 2s
+          mode http
+          bind *:8080
+          http-request use-service lua.donothing
+    
+    Lua conf
+    
+       core.register_service("donothing", "http", function(applet) end)
+    
+    Client request:
+    
+       echo -ne 'GET / HTTP/1.1\n\n' | nc 127.0.0.1 8080
+    
+    Look for CLOSE-WAIT in the connection with "netstat" or "ss". I
+    use this script:
+    
+       while sleep 1; do ss | grep CLOSE-WAIT; done
+    
+    This patch must be backported in 1.6, 1.7 and 1.8
+    
+    Workaround: enable the "hard-stop-after" directive, and perform
+    periodic reload.
+    
+    (cherry picked from commit 70d318ccb760ee25f166a75d163f38545f074ff1)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/hlua.c b/src/hlua.c
+index 54064860..4e50fa64 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -6594,13 +6594,13 @@ static void hlua_applet_http_fct(struct appctx *ctx)
+                       len2 = 0;
+               if (ret == 0)
+                       len1 = 0;
+-              if (len1 + len2 < strm->txn->req.eoh + 2) {
++              if (len1 + len2 < strm->txn->req.eoh + strm->txn->req.eol) {
+                       si_applet_cant_get(si);
+                       return;
+               }
+               /* skip the requests bytes. */
+-              co_skip(si_oc(si), strm->txn->req.eoh + 2);
++              co_skip(si_oc(si), strm->txn->req.eoh + strm->txn->req.eol);
+       }
+       /* Executes The applet if it is not done. */
diff --git a/net/haproxy/patches/0005-MINOR-threads-Introduce-double-width-CAS-on-x86_64-and-arm.patch b/net/haproxy/patches/0005-MINOR-threads-Introduce-double-width-CAS-on-x86_64-and-arm.patch
new file mode 100644 (file)
index 0000000..ee18b21
--- /dev/null
@@ -0,0 +1,186 @@
+commit cd753064396f9563640fef940ce2a89e192042b1
+Author: Olivier Houchard <ohouchard@haproxy.com>
+Date:   Thu Dec 21 17:13:05 2017 +0100
+
+    MINOR: threads: Introduce double-width CAS on x86_64 and arm.
+    
+    Introduce double-width compare-and-swap on arches that support it, right now
+    x86_64, arm, and aarch64.
+    Also introduce functions to do memory barriers.
+    
+    (cherry picked from commit f61f0cb95ffbfe403219226d427cd292ca79965a)
+    [wt: this is backported only to have the barriers for the new rdv point]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/include/common/hathreads.h b/include/common/hathreads.h
+index 25cadf10..543ab95c 100644
+--- a/include/common/hathreads.h
++++ b/include/common/hathreads.h
+@@ -98,6 +98,19 @@ extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the threa
+ #define ha_sigmask(how, set, oldset)  sigprocmask(how, set, oldset)
++
++static inline void __ha_barrier_load(void)
++{
++}
++
++static inline void __ha_barrier_store(void)
++{
++}
++
++static inline void __ha_barrier_full(void)
++{
++}
++
+ #else /* USE_THREAD */
+ #include <stdio.h>
+@@ -694,8 +707,147 @@ static inline void __spin_unlock(enum lock_label lbl, struct ha_spinlock *l,
+ #endif  /* DEBUG_THREAD */
++#ifdef __x86_64__
++#define HA_HAVE_CAS_DW        1
++#define HA_CAS_IS_8B
++static __inline int
++__ha_cas_dw(void *target, void *compare, const void *set)
++{
++        char ret;
++
++        __asm __volatile("lock cmpxchg16b %0; setz %3"
++                          : "+m" (*(void **)target),
++                            "=a" (((void **)compare)[0]),
++                            "=d" (((void **)compare)[1]),
++                            "=q" (ret)
++                          : "a" (((void **)compare)[0]),
++                            "d" (((void **)compare)[1]),
++                            "b" (((const void **)set)[0]),
++                            "c" (((const void **)set)[1])
++                          : "memory", "cc");
++        return (ret);
++}
++
++static __inline void
++__ha_barrier_load(void)
++{
++      __asm __volatile("lfence" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_store(void)
++{
++      __asm __volatile("sfence" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_full(void)
++{
++      __asm __volatile("mfence" ::: "memory");
++}
++
++#elif defined(__arm__) && (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__))
++#define HA_HAVE_CAS_DW        1
++static __inline void
++__ha_barrier_load(void)
++{
++      __asm __volatile("dmb" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_store(void)
++{
++      __asm __volatile("dsb" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_full(void)
++{
++      __asm __volatile("dmb" ::: "memory");
++}
++
++static __inline int __ha_cas_dw(void *target, void *compare, void *set)
++{
++      uint64_t previous;
++      int tmp;
++
++      __asm __volatile("1:"
++                       "ldrexd %0, [%4];"
++                       "cmp %Q0, %Q2;"
++                       "ittt eq;"
++                       "cmpeq %R0, %R2;"
++                       "strexdeq %1, %3, [%4];"
++                       "cmpeq %1, #1;"
++                       "beq 1b;"
++                       : "=&r" (previous), "=&r" (tmp)
++                       : "r" (compare), "r" (set), "r" (target)
++                       : "memory", "cc");
++      tmp = (previous == *(uint64_t *)compare);
++      *(uint64_t *)compare = previous;
++      return (tmp);
++}
++
++#elif defined (__aarch64__)
++#define HA_HAVE_CAS_DW        1
++#define HA_CAS_IS_8B
++
++static __inline void
++__ha_barrier_load(void)
++{
++      __asm __volatile("dmb ishld" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_store(void)
++{
++      __asm __volatile("dmb ishst" ::: "memory");
++}
++
++static __inline void
++__ha_barrier_full(void)
++{
++      __asm __volatile("dmb ish" ::: "memory");
++}
++
++static __inline int __ha_cas_dw(void *target, void *compare, void *set)
++{
++      void *value[2];
++      uint64_t tmp1, tmp2;
++
++      __asm__ __volatile__("1:"
++                             "ldxp %0, %1, [%4];"
++                             "mov %2, %0;"
++                             "mov %3, %1;"
++                             "eor %0, %0, %5;"
++                             "eor %1, %1, %6;"
++                             "orr %1, %0, %1;"
++                             "mov %w0, #0;"
++                             "cbnz %1, 2f;"
++                             "stxp %w0, %7, %8, [%4];"
++                             "cbnz %w0, 1b;"
++                             "mov %w0, #1;"
++                             "2:"
++                             : "=&r" (tmp1), "=&r" (tmp2), "=&r" (value[0]), "=&r" (value[1])
++                             : "r" (target), "r" (((void **)(compare))[0]), "r" (((void **)(compare))[1]), "r" (((void **)(set))[0]), "r" (((void **)(set))[1])
++                             : "cc", "memory");
++
++      memcpy(compare, &value, sizeof(value));
++        return (tmp1);
++}
++
++#else
++#define __ha_barrier_load __sync_synchronize
++#define __ha_barrier_store __sync_synchronize
++#define __ha_barrier_full __sync_synchronize
++#endif
++
+ #endif /* USE_THREAD */
++static inline void __ha_compiler_barrier(void)
++{
++      __asm __volatile("" ::: "memory");
++}
++
+ /* Dummy I/O handler used by the sync pipe.*/
+ void thread_sync_io_handler(int fd);
+ int parse_nbthread(const char *arg, char **err);
diff --git a/net/haproxy/patches/0006-BUG-MEDIUM-threads-fix-the-double-CAS-implementation-for-ARMv7.patch b/net/haproxy/patches/0006-BUG-MEDIUM-threads-fix-the-double-CAS-implementation-for-ARMv7.patch
new file mode 100644 (file)
index 0000000..8c875b7
--- /dev/null
@@ -0,0 +1,41 @@
+commit ad84851746243d85f9be59703e9bee0f5c5f8eba
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Wed Feb 14 14:16:28 2018 +0100
+
+    BUG/MEDIUM: threads: fix the double CAS implementation for ARMv7
+    
+    Commit f61f0cb ("MINOR: threads: Introduce double-width CAS on x86_64
+    and arm.") introduced the double CAS. But the ARMv7 version is bogus,
+    it uses the value of the pointers instead of dereferencing them. When
+    lucky, it simply doesn't build due to impossible registers combinations.
+    Otherwise it will immediately crash at run time when facing traffic.
+    
+    No backport is needed, this bug was introduced in 1.9-dev.
+    
+    (cherry picked from commit 41ccb194d1d14669e0592e5373ef5776f099e82a)
+    [wt: backported only to keep safe code eventhough we don't use
+     this function in 1.8]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/include/common/hathreads.h b/include/common/hathreads.h
+index 543ab95c..4e72848e 100644
+--- a/include/common/hathreads.h
++++ b/include/common/hathreads.h
+@@ -766,7 +766,7 @@ __ha_barrier_full(void)
+       __asm __volatile("dmb" ::: "memory");
+ }
+-static __inline int __ha_cas_dw(void *target, void *compare, void *set)
++static __inline int __ha_cas_dw(void *target, void *compare, const void *set)
+ {
+       uint64_t previous;
+       int tmp;
+@@ -780,7 +780,7 @@ static __inline int __ha_cas_dw(void *target, void *compare, void *set)
+                        "cmpeq %1, #1;"
+                        "beq 1b;"
+                        : "=&r" (previous), "=&r" (tmp)
+-                       : "r" (compare), "r" (set), "r" (target)
++                       : "r" (*(uint64_t *)compare), "r" (*(uint64_t *)set), "r" (target)
+                        : "memory", "cc");
+       tmp = (previous == *(uint64_t *)compare);
+       *(uint64_t *)compare = previous;
diff --git a/net/haproxy/patches/0007-MINOR-threads-add-more-consistency-between-certain-variables-in-no-thread-case.patch b/net/haproxy/patches/0007-MINOR-threads-add-more-consistency-between-certain-variables-in-no-thread-case.patch
new file mode 100644 (file)
index 0000000..0713dd4
--- /dev/null
@@ -0,0 +1,172 @@
+commit ece550d98e1c10017fb91ecfa0d19ae9d2dc45da
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Wed Aug 1 19:12:20 2018 +0200
+
+    MINOR: threads: add more consistency between certain variables in no-thread case
+    
+    When threads are disabled, some variables such as tid and tid_bit are
+    still checked everywhere, the MAX_THREADS_MASK macro is ~0UL while
+    MAX_THREADS is 1, and the all_threads_mask variable is replaced with a
+    macro forced to zero. The compiler cannot optimize away all this code
+    involving checks on tid and tid_bit, and we end up in special cases
+    where all_threads_mask has to be specifically tested for being zero or
+    not. It is not even certain the code paths are always equivalent when
+    testing without threads and with nbthread 1.
+    
+    Let's change this to make sure we always present a single thread when
+    threads are disabled, and have the relevant values declared as constants
+    so that the compiler can optimize all the tests away. Now we have
+    MAX_THREADS_MASK set to 1, all_threads_mask set to 1, tid set to zero
+    and tid_bit set to 1. Doing just this has removed 4 kB of code in the
+    no-thread case.
+    
+    A few checks for all_threads_mask==0 have been removed since it never
+    happens anymore.
+    
+    (cherry picked from commit 0c026f49e7348bce5b3c74be896ae208ae6e26a4)
+    [wt: the thread code feels safer with this, especially with the small updates
+         needed for the rdv point; missed one occurrence fixed by next patch]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/include/common/hathreads.h b/include/common/hathreads.h
+index 4e72848e..7eb5d127 100644
+--- a/include/common/hathreads.h
++++ b/include/common/hathreads.h
+@@ -24,10 +24,6 @@
+ #include <common/config.h>
+-#define MAX_THREADS_MASK ((unsigned long)-1)
+-extern THREAD_LOCAL unsigned int tid;     /* The thread id */
+-extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the thread id */
+-
+ /* Note about all_threads_mask :
+  *    - with threads support disabled, this symbol is defined as zero (0UL).
+  *    - with threads enabled, this variable is never zero, it contains the mask
+@@ -37,7 +33,14 @@ extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the threa
+ #ifndef USE_THREAD
+ #define MAX_THREADS 1
+-#define all_threads_mask 0UL
++#define MAX_THREADS_MASK 1
++
++/* Only way found to replace variables with constants that are optimized away
++ * at build time.
++ */
++enum { all_threads_mask = 1UL };
++enum { tid_bit = 1UL };
++enum { tid = 0 };
+ #define __decl_hathreads(decl)
+@@ -98,6 +101,9 @@ extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the threa
+ #define ha_sigmask(how, set, oldset)  sigprocmask(how, set, oldset)
++static inline void ha_set_tid(unsigned int tid)
++{
++}
+ static inline void __ha_barrier_load(void)
+ {
+@@ -120,6 +126,7 @@ static inline void __ha_barrier_full(void)
+ #include <import/plock.h>
+ #define MAX_THREADS LONGBITS
++#define MAX_THREADS_MASK ((unsigned long)-1)
+ #define __decl_hathreads(decl) decl
+@@ -223,10 +230,19 @@ void thread_exit_sync(void);
+ int  thread_no_sync(void);
+ int  thread_need_sync(void);
++extern THREAD_LOCAL unsigned int tid;     /* The thread id */
++extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the thread id */
+ extern volatile unsigned long all_threads_mask;
+ #define ha_sigmask(how, set, oldset)  pthread_sigmask(how, set, oldset)
++/* sets the thread ID and the TID bit for the current thread */
++static inline void ha_set_tid(unsigned int data)
++{
++      tid     = data;
++      tid_bit = (1UL << tid);
++}
++
+ #if defined(DEBUG_THREAD) || defined(DEBUG_FULL)
+diff --git a/src/cfgparse.c b/src/cfgparse.c
+index 24349a59..d1474d4b 100644
+--- a/src/cfgparse.c
++++ b/src/cfgparse.c
+@@ -7652,11 +7652,11 @@ int check_config_validity()
+                               nbproc = my_ffsl(bind_conf->bind_proc);
+                       mask = bind_conf->bind_thread[nbproc - 1];
+-                      if (mask && !(mask & (all_threads_mask ? all_threads_mask : 1UL))) {
++                      if (mask && !(mask & all_threads_mask)) {
+                               unsigned long new_mask = 0;
+                               while (mask) {
+-                                      new_mask |= mask & (all_threads_mask ? all_threads_mask : 1UL);
++                                      new_mask |= mask & all_threads_mask;
+                                       mask >>= global.nbthread;
+                               }
+diff --git a/src/haproxy.c b/src/haproxy.c
+index 9ba56623..e0186ff9 100644
+--- a/src/haproxy.c
++++ b/src/haproxy.c
+@@ -2448,8 +2448,7 @@ static void *run_thread_poll_loop(void *data)
+       struct per_thread_deinit_fct *ptdf;
+       __decl_hathreads(static HA_SPINLOCK_T start_lock);
+-      tid     = *((unsigned int *)data);
+-      tid_bit = (1UL << tid);
++      ha_set_tid(*((unsigned int *)data));
+       tv_update_date(-1,-1);
+       list_for_each_entry(ptif, &per_thread_init_list, list) {
+diff --git a/src/hathreads.c b/src/hathreads.c
+index 0d0a0509..238cbb80 100644
+--- a/src/hathreads.c
++++ b/src/hathreads.c
+@@ -19,8 +19,6 @@
+ #include <common/standard.h>
+ #include <proto/fd.h>
+-THREAD_LOCAL unsigned int tid      = 0;
+-THREAD_LOCAL unsigned long tid_bit = (1UL << 0);
+ /* Dummy I/O handler used by the sync pipe.*/
+ void thread_sync_io_handler(int fd)
+@@ -33,6 +31,9 @@ static HA_SPINLOCK_T sync_lock;
+ static int           threads_sync_pipe[2];
+ static unsigned long threads_want_sync = 0;
+ volatile unsigned long all_threads_mask  = 1; // nbthread 1 assumed by default
++THREAD_LOCAL unsigned int  tid           = 0;
++THREAD_LOCAL unsigned long tid_bit       = (1UL << 0);
++
+ #if defined(DEBUG_THREAD) || defined(DEBUG_FULL)
+ struct lock_stat lock_stats[LOCK_LABELS];
+@@ -130,7 +131,7 @@ void thread_enter_sync()
+ {
+       static volatile unsigned long barrier = 0;
+-      if (!all_threads_mask)
++      if (!(all_threads_mask & (all_threads_mask - 1)))
+               return;
+       thread_sync_barrier(&barrier);
+@@ -146,7 +147,7 @@ void thread_exit_sync()
+ {
+       static volatile unsigned long barrier = 0;
+-      if (!all_threads_mask)
++      if (!(all_threads_mask & (all_threads_mask - 1)))
+               return;
+       if (threads_want_sync & tid_bit)
diff --git a/net/haproxy/patches/0008-BUG-MEDIUM-threads-fix-the-no-thread-case-after-the-change-to-the-sync-point.patch b/net/haproxy/patches/0008-BUG-MEDIUM-threads-fix-the-no-thread-case-after-the-change-to-the-sync-point.patch
new file mode 100644 (file)
index 0000000..9231e46
--- /dev/null
@@ -0,0 +1,31 @@
+commit 7607ec0917c33ce511d46b791dfa5550451dd538
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Tue Aug 7 10:07:15 2018 +0200
+
+    BUG/MEDIUM: threads: fix the no-thread case after the change to the sync point
+    
+    In commit 0c026f4 ("MINOR: threads: add more consistency between certain
+    variables in no-thread case"), we ensured that we don't have all_threads_mask
+    zeroed anymore. But one test was missed for the write() to the sync pipe.
+    This results in a situation where when running single-threaded, once a
+    server status changes, a wake-up message is written to the pipe and never
+    consumed, showing a 100% CPU usage.
+    
+    No backport is needed.
+    (cherry picked from commit ab657ce2511c4e19b0191fbe1c98cfd823a3c5d6)
+    [wt: the offending patch was just backported as the previous one]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/hathreads.c b/src/hathreads.c
+index 238cbb80..ba05fe27 100644
+--- a/src/hathreads.c
++++ b/src/hathreads.c
+@@ -71,7 +71,7 @@ void thread_sync_enable(void)
+  */
+ void thread_want_sync()
+ {
+-      if (all_threads_mask) {
++      if (all_threads_mask & (all_threads_mask - 1)) {
+               if (threads_want_sync & tid_bit)
+                       return;
+               if (HA_ATOMIC_OR(&threads_want_sync, tid_bit) == tid_bit)
diff --git a/net/haproxy/patches/0009-MEDIUM-hathreads-implement-a-more-flexible-rendez-vous-point.patch b/net/haproxy/patches/0009-MEDIUM-hathreads-implement-a-more-flexible-rendez-vous-point.patch
new file mode 100644 (file)
index 0000000..a12d361
--- /dev/null
@@ -0,0 +1,340 @@
+commit b505a8d719c208073959eff07f4af202ef49a8a1
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Thu Aug 2 10:16:17 2018 +0200
+
+    MEDIUM: hathreads: implement a more flexible rendez-vous point
+    
+    The current synchronization point enforces certain restrictions which
+    are hard to workaround in certain areas of the code. The fact that the
+    critical code can only be called from the sync point itself is a problem
+    for some callback-driven parts. The "show fd" command for example is
+    fragile regarding this.
+    
+    Also it is expensive in terms of CPU usage because it wakes every other
+    thread just to be sure all of them join to the rendez-vous point. It's a
+    problem because the sleeping threads would not need to be woken up just
+    to know they're doing nothing.
+    
+    Here we implement a different approach. We keep track of harmless threads,
+    which are defined as those either doing nothing, or doing harmless things.
+    The rendez-vous is used "for others" as a way for a thread to isolate itself.
+    A thread then requests to be alone using thread_isolate() when approaching
+    the dangerous area, and then waits until all other threads are either doing
+    the same or are doing something harmless (typically polling). The function
+    only returns once the thread is guaranteed to be alone, and the critical
+    section is terminated using thread_release().
+    
+    (cherry picked from commit 60b639ccbe919b86790267d7e45a39b75434acbe)
+    [wt: this will be needed to fix the "show fd" command with threads]
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/include/common/hathreads.h b/include/common/hathreads.h
+index 7eb5d127..f8fda87a 100644
+--- a/include/common/hathreads.h
++++ b/include/common/hathreads.h
+@@ -117,6 +117,27 @@ static inline void __ha_barrier_full(void)
+ {
+ }
++static inline void thread_harmless_now()
++{
++}
++
++static inline void thread_harmless_end()
++{
++}
++
++static inline void thread_isolate()
++{
++}
++
++static inline void thread_release()
++{
++}
++
++static inline unsigned long thread_isolated()
++{
++      return 1;
++}
++
+ #else /* USE_THREAD */
+ #include <stdio.h>
+@@ -229,10 +250,34 @@ void thread_enter_sync(void);
+ void thread_exit_sync(void);
+ int  thread_no_sync(void);
+ int  thread_need_sync(void);
++void thread_harmless_till_end();
++void thread_isolate();
++void thread_release();
+ extern THREAD_LOCAL unsigned int tid;     /* The thread id */
+ extern THREAD_LOCAL unsigned long tid_bit; /* The bit corresponding to the thread id */
+ extern volatile unsigned long all_threads_mask;
++extern volatile unsigned long threads_want_rdv_mask;
++extern volatile unsigned long threads_harmless_mask;
++
++/* explanation for threads_want_rdv_mask and threads_harmless_mask :
++ * - threads_want_rdv_mask is a bit field indicating all threads that have
++ *   requested a rendez-vous of other threads using thread_isolate().
++ * - threads_harmless_mask is a bit field indicating all threads that are
++ *   currently harmless in that they promise not to access a shared resource.
++ *
++ * For a given thread, its bits in want_rdv and harmless can be translated like
++ * this :
++ *
++ *  ----------+----------+----------------------------------------------------
++ *   want_rdv | harmless | description
++ *  ----------+----------+----------------------------------------------------
++ *       0    |     0    | thread not interested in RDV, possibly harmful
++ *       0    |     1    | thread not interested in RDV but harmless
++ *       1    |     1    | thread interested in RDV and waiting for its turn
++ *       1    |     0    | thread currently working isolated from others
++ *  ----------+----------+----------------------------------------------------
++ */
+ #define ha_sigmask(how, set, oldset)  pthread_sigmask(how, set, oldset)
+@@ -243,6 +288,38 @@ static inline void ha_set_tid(unsigned int data)
+       tid_bit = (1UL << tid);
+ }
++/* Marks the thread as harmless. Note: this must be true, i.e. the thread must
++ * not be touching any unprotected shared resource during this period. Usually
++ * this is called before poll(), but it may also be placed around very slow
++ * calls (eg: some crypto operations). Needs to be terminated using
++ * thread_harmless_end().
++ */
++static inline void thread_harmless_now()
++{
++      HA_ATOMIC_OR(&threads_harmless_mask, tid_bit);
++}
++
++/* Ends the harmless period started by thread_harmless_now(). Usually this is
++ * placed after the poll() call. If it is discovered that a job was running and
++ * is relying on the thread still being harmless, the thread waits for the
++ * other one to finish.
++ */
++static inline void thread_harmless_end()
++{
++      while (1) {
++              HA_ATOMIC_AND(&threads_harmless_mask, ~tid_bit);
++              if (likely((threads_want_rdv_mask & all_threads_mask) == 0))
++                      break;
++              thread_harmless_till_end();
++      }
++}
++
++/* an isolated thread has harmless cleared and want_rdv set */
++static inline unsigned long thread_isolated()
++{
++      return threads_want_rdv_mask & ~threads_harmless_mask & tid_bit;
++}
++
+ #if defined(DEBUG_THREAD) || defined(DEBUG_FULL)
+diff --git a/src/ev_epoll.c b/src/ev_epoll.c
+index adc15acd..09d1abb6 100644
+--- a/src/ev_epoll.c
++++ b/src/ev_epoll.c
+@@ -17,6 +17,7 @@
+ #include <common/config.h>
+ #include <common/debug.h>
+ #include <common/epoll.h>
++#include <common/hathreads.h>
+ #include <common/standard.h>
+ #include <common/ticks.h>
+ #include <common/time.h>
+@@ -153,6 +154,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       }
+       HA_SPIN_UNLOCK(FD_UPDATE_LOCK, &fd_updt_lock);
++      thread_harmless_now();
++
+       /* compute the epoll_wait() timeout */
+       if (!exp)
+               wait_time = MAX_DELAY_MS;
+@@ -173,6 +176,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       tv_update_date(wait_time, status);
+       measure_idle();
++      thread_harmless_end();
++
+       /* process polled events */
+       for (count = 0; count < status; count++) {
+diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c
+index 642de8b3..1f4762e6 100644
+--- a/src/ev_kqueue.c
++++ b/src/ev_kqueue.c
+@@ -19,6 +19,7 @@
+ #include <common/compat.h>
+ #include <common/config.h>
++#include <common/hathreads.h>
+ #include <common/ticks.h>
+ #include <common/time.h>
+ #include <common/tools.h>
+@@ -127,6 +128,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       }
+       HA_SPIN_UNLOCK(FD_UPDATE_LOCK, &fd_updt_lock);
++      thread_harmless_now();
++
+       if (changes) {
+ #ifdef EV_RECEIPT
+               kev[0].flags |= EV_RECEIPT;
+@@ -169,6 +172,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       tv_update_date(delta_ms, status);
+       measure_idle();
++      thread_harmless_end();
++
+       for (count = 0; count < status; count++) {
+               unsigned int n = 0;
+               fd = kev[count].ident;
+diff --git a/src/ev_poll.c b/src/ev_poll.c
+index c913ced2..7da992d6 100644
+--- a/src/ev_poll.c
++++ b/src/ev_poll.c
+@@ -19,6 +19,7 @@
+ #include <common/compat.h>
+ #include <common/config.h>
++#include <common/hathreads.h>
+ #include <common/ticks.h>
+ #include <common/time.h>
+@@ -149,6 +150,9 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       }
+       HA_SPIN_UNLOCK(FD_UPDATE_LOCK, &fd_updt_lock);
++
++      thread_harmless_now();
++
+       fd_nbupdt = 0;
+       nbfd = 0;
+@@ -200,6 +204,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       tv_update_date(wait_time, status);
+       measure_idle();
++      thread_harmless_end();
++
+       for (count = 0; status > 0 && count < nbfd; count++) {
+               unsigned int n;
+               int e = poll_events[count].revents;
+diff --git a/src/ev_select.c b/src/ev_select.c
+index bde923ea..9daf74d9 100644
+--- a/src/ev_select.c
++++ b/src/ev_select.c
+@@ -16,6 +16,7 @@
+ #include <common/compat.h>
+ #include <common/config.h>
++#include <common/hathreads.h>
+ #include <common/ticks.h>
+ #include <common/time.h>
+@@ -123,6 +124,9 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       }
+       HA_SPIN_UNLOCK(FD_UPDATE_LOCK, &fd_updt_lock);
++
++      thread_harmless_now();
++
+       fd_nbupdt = 0;
+       /* let's restore fdset state */
+@@ -171,6 +175,8 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
+       tv_update_date(delta_ms, status);
+       measure_idle();
++      thread_harmless_end();
++
+       if (status <= 0)
+               return;
+diff --git a/src/hathreads.c b/src/hathreads.c
+index ba05fe27..97ed31c5 100644
+--- a/src/hathreads.c
++++ b/src/hathreads.c
+@@ -30,6 +30,8 @@ void thread_sync_io_handler(int fd)
+ static HA_SPINLOCK_T sync_lock;
+ static int           threads_sync_pipe[2];
+ static unsigned long threads_want_sync = 0;
++volatile unsigned long threads_want_rdv_mask = 0;
++volatile unsigned long threads_harmless_mask = 0;
+ volatile unsigned long all_threads_mask  = 1; // nbthread 1 assumed by default
+ THREAD_LOCAL unsigned int  tid           = 0;
+ THREAD_LOCAL unsigned long tid_bit       = (1UL << 0);
+@@ -163,6 +165,68 @@ void thread_exit_sync()
+       thread_sync_barrier(&barrier);
+ }
++/* Marks the thread as harmless until the last thread using the rendez-vous
++ * point quits. Given that we can wait for a long time, sched_yield() is used
++ * when available to offer the CPU resources to competing threads if needed.
++ */
++void thread_harmless_till_end()
++{
++              HA_ATOMIC_OR(&threads_harmless_mask, tid_bit);
++              while (threads_want_rdv_mask & all_threads_mask) {
++#if _POSIX_PRIORITY_SCHEDULING
++                      sched_yield();
++#else
++                      pl_cpu_relax();
++#endif
++              }
++}
++
++/* Isolates the current thread : request the ability to work while all other
++ * threads are harmless. Only returns once all of them are harmless, with the
++ * current thread's bit in threads_harmless_mask cleared. Needs to be completed
++ * using thread_release().
++ */
++void thread_isolate()
++{
++      unsigned long old;
++
++      HA_ATOMIC_OR(&threads_harmless_mask, tid_bit);
++      __ha_barrier_store();
++      HA_ATOMIC_OR(&threads_want_rdv_mask, tid_bit);
++
++      /* wait for all threads to become harmless */
++      old = threads_harmless_mask;
++      while (1) {
++              if (unlikely((old & all_threads_mask) != all_threads_mask))
++                      old = threads_harmless_mask;
++              else if (HA_ATOMIC_CAS(&threads_harmless_mask, &old, old & ~tid_bit))
++                      break;
++
++#if _POSIX_PRIORITY_SCHEDULING
++              sched_yield();
++#else
++              pl_cpu_relax();
++#endif
++      }
++      /* one thread gets released at a time here, with its harmess bit off.
++       * The loss of this bit makes the other one continue to spin while the
++       * thread is working alone.
++       */
++}
++
++/* Cancels the effect of thread_isolate() by releasing the current thread's bit
++ * in threads_want_rdv_mask and by marking this thread as harmless until the
++ * last worker finishes.
++ */
++void thread_release()
++{
++      while (1) {
++              HA_ATOMIC_AND(&threads_want_rdv_mask, ~tid_bit);
++              if (!(threads_want_rdv_mask & all_threads_mask))
++                      break;
++              thread_harmless_till_end();
++      }
++}
+ __attribute__((constructor))
+ static void __hathreads_init(void)
diff --git a/net/haproxy/patches/0010-BUG-MEDIUM-cli-make-show-fd-thread-safe.patch b/net/haproxy/patches/0010-BUG-MEDIUM-cli-make-show-fd-thread-safe.patch
new file mode 100644 (file)
index 0000000..efefdd6
--- /dev/null
@@ -0,0 +1,50 @@
+commit f41ca2546e3c35cc389f45428341ec03dade314d
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Thu Aug 2 11:05:48 2018 +0200
+
+    BUG/MEDIUM: cli: make "show fd" thread-safe
+    
+    The "show fd" command was implemented as a debugging aid but it's not
+    thread safe. Its features have grown, it can now dump some mux-specific
+    parts and is being used in production to capture some useful debugging
+    traces. But it will quickly crash the process when used during an H2 load
+    test for example, especially when haproxy is built with the DEBUG_UAF
+    option. It cannot afford not to be thread safe anymore. Let's make use
+    of the new rendez-vous point using thread_isolate() / thread_release()
+    to ensure that the data being dumped are not changing under us. The dump
+    becomes slightly slower under load but now it's safe.
+    
+    This should be backported to 1.8 along with the rendez-vous point code
+    once considered stable enough.
+    (cherry picked from commit bf9fd650883b23604b7cd4aabf04fc0c4c8fe7c7)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/cli.c b/src/cli.c
+index 233c2323..8344fe10 100644
+--- a/src/cli.c
++++ b/src/cli.c
+@@ -787,10 +787,14 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
+               void *ctx = NULL;
+               uint32_t conn_flags = 0;
++              thread_isolate();
++
+               fdt = fdtab[fd];
+-              if (!fdt.owner)
++              if (!fdt.owner) {
++                      thread_release();
+                       goto skip; // closed
++              }
+               if (fdt.iocb == conn_fd_handler) {
+                       conn_flags = ((struct connection *)fdt.owner)->flags;
+@@ -855,6 +859,8 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
+                                     li->bind_conf->frontend->id);
+               }
++              thread_release();
++
+               chunk_appendf(&trash, "\n");
+               if (ci_putchk(si_ic(si), &trash) == -1) {
diff --git a/net/haproxy/patches/0011-BUG-MINOR-ssl-empty-connections-reported-as-errors.patch b/net/haproxy/patches/0011-BUG-MINOR-ssl-empty-connections-reported-as-errors.patch
new file mode 100644 (file)
index 0000000..99e508a
--- /dev/null
@@ -0,0 +1,43 @@
+commit 8c2e3b35a951c41b80efe4c3368d1244bab2bea4
+Author: Emeric Brun <ebrun@haproxy.com>
+Date:   Thu Aug 16 11:36:40 2018 +0200
+
+    BUG/MINOR: ssl: empty connections reported as errors.
+    
+    Empty connection is reported as handshake error
+    even if dont-log-null is specified.
+    
+    This bug affect is a regression du to:
+    
+    BUILD: ssl: fix to build (again) with boringssl
+    
+    New openssl 1.1.1 defines OPENSSL_NO_HEARTBEATS as boring ssl
+    so the test was replaced by OPENSSL_IS_BORINGSSL
+    
+    This fix should be backported on 1.8
+    
+    (cherry picked from commit 77e8919fc6f382f3a7facdc814b8618b8987200f)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 7edfb799..49389f01 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -5121,7 +5121,7 @@ int ssl_sock_handshake(struct connection *conn, unsigned int flag)
+                               if (!errno && conn->flags & CO_FL_WAIT_L4_CONN)
+                                       conn->flags &= ~CO_FL_WAIT_L4_CONN;
+                               if (!conn->err_code) {
+-#ifdef OPENSSL_NO_HEARTBEATS  /* BoringSSL */
++#ifdef OPENSSL_IS_BORINGSSL /* BoringSSL */
+                                       conn->err_code = CO_ER_SSL_HANDSHAKE;
+ #else
+                                       int empty_handshake;
+@@ -5205,7 +5205,7 @@ check_error:
+                       if (!errno && conn->flags & CO_FL_WAIT_L4_CONN)
+                               conn->flags &= ~CO_FL_WAIT_L4_CONN;
+                       if (!conn->err_code) {
+-#ifdef OPENSSL_NO_HEARTBEATS  /* BoringSSL */
++#ifdef OPENSSL_IS_BORINGSSL  /* BoringSSL */
+                               conn->err_code = CO_ER_SSL_HANDSHAKE;
+ #else
+                               int empty_handshake;
diff --git a/net/haproxy/patches/0012-BUG-MEDIUM-ssl-fix-missing-error-loading-a-keytype-cert-from-a-bundle.patch b/net/haproxy/patches/0012-BUG-MEDIUM-ssl-fix-missing-error-loading-a-keytype-cert-from-a-bundle.patch
new file mode 100644 (file)
index 0000000..57d1f19
--- /dev/null
@@ -0,0 +1,27 @@
+commit 9923082f94e0af83d03e030f4274d3db374b248c
+Author: Emeric Brun <ebrun@haproxy.com>
+Date:   Thu Aug 16 15:11:12 2018 +0200
+
+    BUG/MEDIUM: ssl: fix missing error loading a keytype cert from a bundle.
+    
+    If there was an issue loading a keytype's part of a bundle, the bundle
+    was implicitly ignored without errors.
+    
+    This patch should be backported in 1.8 (and perhaps 1.7)
+    
+    (cherry picked from commit eb155b6ca6c1a8aaffa30285d453909b97979f5f)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 49389f01..9f0ff1f0 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -3475,7 +3475,7 @@ int ssl_sock_load_cert(char *path, struct bind_conf *bind_conf, char **err)
+                                               }
+                                               snprintf(fp, sizeof(fp), "%s/%s", path, dp);
+-                                              ssl_sock_load_multi_cert(fp, bind_conf, NULL, NULL, 0, err);
++                                              cfgerr += ssl_sock_load_multi_cert(fp, bind_conf, NULL, NULL, 0, err);
+                                               /* Successfully processed the bundle */
+                                               goto ignore_entry;
diff --git a/net/haproxy/patches/0013-BUG-MEDIUM-ssl-loading-dh-param-from-certifile-causes-unpredictable-error.patch b/net/haproxy/patches/0013-BUG-MEDIUM-ssl-loading-dh-param-from-certifile-causes-unpredictable-error.patch
new file mode 100644 (file)
index 0000000..9591c27
--- /dev/null
@@ -0,0 +1,28 @@
+commit 399714287a04d6b453ba95e4a3904a7644827d0b
+Author: Emeric Brun <ebrun@haproxy.com>
+Date:   Thu Aug 16 15:14:12 2018 +0200
+
+    BUG/MEDIUM: ssl: loading dh param from certifile causes unpredictable error.
+    
+    If the dh parameter is not found, the openssl's error global
+    stack was not correctly cleared causing unpredictable error
+    during the following parsing (chain cert parsing for instance).
+    
+    This patch should be backported in 1.8 (and perhaps 1.7)
+    
+    (cherry picked from commit e1b4ed4352619f985d7d65f5d95a830ef5775c46)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 9f0ff1f0..9be2fc4c 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -2597,6 +2597,8 @@ end:
+         if (in)
+                 BIO_free(in);
++      ERR_clear_error();
++
+       return dh;
+ }
diff --git a/net/haproxy/patches/0014-BUG-MINOR-map-fix-map_regm-with-backref.patch b/net/haproxy/patches/0014-BUG-MINOR-map-fix-map_regm-with-backref.patch
new file mode 100644 (file)
index 0000000..2f9d79b
--- /dev/null
@@ -0,0 +1,48 @@
+commit a1110e24e5be53ba5fe9ab82372c02a60da06cf9
+Author: Emeric Brun <ebrun@haproxy.com>
+Date:   Tue Jul 17 09:47:07 2018 -0400
+
+    BUG/MINOR: map: fix map_regm with backref
+    
+    Due to a cascade of get_trash_chunk calls the sample is
+    corrupted when we want to read it.
+    
+    The fix consist to use a temporary chunk to copy the sample
+    value and use it.
+    
+    (cherry picked from commit 271022150d7961b9aa39dbfd88e0c6a4bc48c3ee)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/map.c b/src/map.c
+index a9a1e53c..da399088 100644
+--- a/src/map.c
++++ b/src/map.c
+@@ -184,10 +184,27 @@ static int sample_conv_map(const struct arg *arg_p, struct sample *smp, void *pr
+               if (pat->data) {
+                       /* In the regm case, merge the sample with the input. */
+                       if ((long)private == PAT_MATCH_REGM) {
++                              struct chunk *tmptrash;
++
++                              /* Copy the content of the sample because it could
++                                 be scratched by incoming get_trash_chunk */
++                              tmptrash = alloc_trash_chunk();
++                              if (!tmptrash)
++                                      return 0;
++
++                              tmptrash->len = smp->data.u.str.len;
++                              if (tmptrash->len > (tmptrash->size-1))
++                                      tmptrash->len = tmptrash->size-1;
++
++                              memcpy(tmptrash->str, smp->data.u.str.str, tmptrash->len);
++                              tmptrash->str[tmptrash->len] = 0;
++
+                               str = get_trash_chunk();
+-                              str->len = exp_replace(str->str, str->size, smp->data.u.str.str,
++                              str->len = exp_replace(str->str, str->size, tmptrash->str,
+                                                      pat->data->u.str.str,
+                                                      (regmatch_t *)smp->ctx.a[0]);
++
++                              free_trash_chunk(tmptrash);
+                               if (str->len == -1)
+                                       return 0;
+                               smp->data.u.str = *str;
diff --git a/net/haproxy/patches/0015-DOC-dns-explain-set-server-fqdn-requires-resolver.patch b/net/haproxy/patches/0015-DOC-dns-explain-set-server-fqdn-requires-resolver.patch
new file mode 100644 (file)
index 0000000..e8455e3
--- /dev/null
@@ -0,0 +1,29 @@
+commit 29a43c20faa06100ade61fc24a5ee3bddfa3021a
+Author: Lukas Tribus <lukas@ltri.eu>
+Date:   Tue Aug 14 11:39:35 2018 +0200
+
+    DOC: dns: explain set server ... fqdn requires resolver
+    
+    Abhishek Gupta reported on discourse that set server [...] fqdn always
+    fails. Further investigation showed that this requires the internal
+    DNS resolver to be configured. Add this requirement to the docs.
+    
+    Must be backported to 1.8.
+    
+    (cherry picked from commit c5dd5a500a237780eb9ab6e7069949cb19b6ff7d)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/doc/management.txt b/doc/management.txt
+index 68a17c25..46e7fd07 100644
+--- a/doc/management.txt
++++ b/doc/management.txt
+@@ -1675,7 +1675,8 @@ set server <backend>/<server> weight <weight>[%]
+   equivalent of the "set weight" command below.
+ set server <backend>/<server> fqdn <FQDN>
+-  Change a server's FQDN to the value passed in argument.
++  Change a server's FQDN to the value passed in argument. This requires the
++  internal run-time DNS resolver to be configured and enabled for this server.
+ set severity-output [ none | number | string ]
+   Change the severity output format of the stats socket connected to for the
diff --git a/net/haproxy/patches/0016-DOC-ssl-Use-consistent-naming-for-TLS-protocols.patch b/net/haproxy/patches/0016-DOC-ssl-Use-consistent-naming-for-TLS-protocols.patch
new file mode 100644 (file)
index 0000000..f0f0f43
--- /dev/null
@@ -0,0 +1,49 @@
+commit 54aecf18aeabe09bccf8db5e34b99bc36d468088
+Author: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date:   Tue Aug 14 00:56:13 2018 +0100
+
+    DOC: ssl: Use consistent naming for TLS protocols
+    
+    In most cases, "TLSv1.x" naming is used across and documentation, lazy
+    people tend to grep too much and may not find what they are looking for.
+    
+    Fixing people is hard.
+    
+    (cherry picked from commit a25282bb399bfad8ed04b494b567fe97f0a58d65)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/doc/configuration.txt b/doc/configuration.txt
+index 1973bbf2..43e28785 100644
+--- a/doc/configuration.txt
++++ b/doc/configuration.txt
+@@ -10447,7 +10447,7 @@ accept-proxy
+   setting of which client is allowed to use the protocol.
+ allow-0rtt
+-  Allow receiving early data when using TLS 1.3. This is disabled by default,
++  Allow receiving early data when using TLSv1.3. This is disabled by default,
+   due to security considerations.
+ alpn <protocols>
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 9be2fc4c..0b49e0b4 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -1986,7 +1986,7 @@ static void ctx_set_TLSv12_func(SSL_CTX *ctx, set_context_func c) {
+               : SSL_CTX_set_ssl_version(ctx, TLSv1_2_client_method());
+ #endif
+ }
+-/* TLS 1.2 is the last supported version in this context. */
++/* TLSv1.2 is the last supported version in this context. */
+ static void ctx_set_TLSv13_func(SSL_CTX *ctx, set_context_func c) {}
+ /* Unusable in this context. */
+ static void ssl_set_SSLv3_func(SSL *ssl, set_context_func c) {}
+@@ -2187,7 +2187,7 @@ static int ssl_sock_switchctx_cbk(SSL *ssl, int *al, void *arg)
+                               break;
+               }
+       } else {
+-              /* without TLSEXT_TYPE_signature_algorithms extension (< TLS 1.2) */
++              /* without TLSEXT_TYPE_signature_algorithms extension (< TLSv1.2) */
+               has_rsa = 1;
+       }
+       if (has_ecdsa_sig) {  /* in very rare case: has ecdsa sign but not a ECDSA cipher */
diff --git a/net/haproxy/patches/0017-BUG-MEDIUM-lua-socket-timeouts-are-not-applied.patch b/net/haproxy/patches/0017-BUG-MEDIUM-lua-socket-timeouts-are-not-applied.patch
new file mode 100644 (file)
index 0000000..3df6b31
--- /dev/null
@@ -0,0 +1,42 @@
+commit 947a3f71ad9733dde6645edb91b6becb3ee51e7c
+Author: Cyril Bonté <cyril.bonte@free.fr>
+Date:   Fri Aug 17 23:51:02 2018 +0200
+
+    BUG/MEDIUM: lua: socket timeouts are not applied
+    
+    Sachin Shetty reported that socket timeouts set in LUA code have no effect.
+    Indeed, connect timeout is never modified and is always set to its default,
+    set to 5 seconds. Currently, this patch will apply the specified timeout
+    value to the connect timeout.
+    For the read and write timeouts, the issue is that the timeout is updated but
+    the expiration dates were not updated.
+    
+    This patch should be backported up to the 1.6 branch.
+    
+    (cherry picked from commit 7bb634549794298fc701d33efd93c7289dcf9cb7)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/hlua.c b/src/hlua.c
+index 4e50fa64..daf775fc 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -2566,10 +2566,19 @@ __LJMP static int hlua_socket_settimeout(struct lua_State *L)
+       si = appctx->owner;
+       s = si_strm(si);
++      s->sess->fe->timeout.connect = tmout;
+       s->req.rto = tmout;
+       s->req.wto = tmout;
+       s->res.rto = tmout;
+       s->res.wto = tmout;
++      s->req.rex = tick_add_ifset(now_ms, tmout);
++      s->req.wex = tick_add_ifset(now_ms, tmout);
++      s->res.rex = tick_add_ifset(now_ms, tmout);
++      s->res.wex = tick_add_ifset(now_ms, tmout);
++
++      s->task->expire = tick_add_ifset(now_ms, tmout);
++      task_queue(s->task);
++
+       xref_unlock(&socket->xref, peer);
+       lua_pushinteger(L, 1);
diff --git a/net/haproxy/patches/0018-BUG-MEDIUM-cli-threads-protect-all-proxy-commands-against-concurrent-updates.patch b/net/haproxy/patches/0018-BUG-MEDIUM-cli-threads-protect-all-proxy-commands-against-concurrent-updates.patch
new file mode 100644 (file)
index 0000000..385db51
--- /dev/null
@@ -0,0 +1,212 @@
+commit 3c42f13badd149c9c3152d7b2e653bde5da7c17a
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Tue Aug 21 14:50:44 2018 +0200
+
+    BUG/MEDIUM: cli/threads: protect all "proxy" commands against concurrent updates
+    
+    The proxy-related commands like "{enable|disable|shutdown} frontend",
+    "{enable|disable} dynamic-cookie", "set dynamic-cookie-key" were not
+    protected against concurrent accesses making their use dangerous with
+    threads.
+    
+    This patch must be backported to 1.8.
+    
+    (cherry picked from commit a275a3710eaa365150fe89e2e7a8fbdce87bb30e)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/proxy.c b/src/proxy.c
+index 4437b703..8926ba8b 100644
+--- a/src/proxy.c
++++ b/src/proxy.c
+@@ -1560,7 +1560,10 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
+       return 1;
+ }
+-/* Parses the "enable dynamic-cookies backend" directive, it always returns 1 */
++/* Parses the "enable dynamic-cookies backend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock and each server's lock.
++ */
+ static int cli_parse_enable_dyncookie_backend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
+@@ -1573,15 +1576,25 @@ static int cli_parse_enable_dyncookie_backend(char **args, struct appctx *appctx
+       if (!px)
+               return 1;
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++
+       px->ck_opts |= PR_CK_DYNAMIC;
+-      for (s = px->srv; s != NULL; s = s->next)
++      for (s = px->srv; s != NULL; s = s->next) {
++              HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
+               srv_set_dyncookie(s);
++              HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
++      }
++
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
+       return 1;
+ }
+-/* Parses the "disable dynamic-cookies backend" directive, it always returns 1 */
++/* Parses the "disable dynamic-cookies backend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock and each server's lock.
++ */
+ static int cli_parse_disable_dyncookie_backend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
+@@ -1594,19 +1607,28 @@ static int cli_parse_disable_dyncookie_backend(char **args, struct appctx *appct
+       if (!px)
+               return 1;
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++
+       px->ck_opts &= ~PR_CK_DYNAMIC;
+       for (s = px->srv; s != NULL; s = s->next) {
++              HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
+               if (!(s->flags & SRV_F_COOKIESET)) {
+                       free(s->cookie);
+                       s->cookie = NULL;
+               }
++              HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
+       }
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
++
+       return 1;
+ }
+-/* Parses the "set dynamic-cookie-key backend" directive, it always returns 1 */
++/* Parses the "set dynamic-cookie-key backend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock and each server's lock.
++ */
+ static int cli_parse_set_dyncookie_key_backend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
+@@ -1634,16 +1656,27 @@ static int cli_parse_set_dyncookie_key_backend(char **args, struct appctx *appct
+               appctx->st0 = CLI_ST_PRINT;
+               return 1;
+       }
++
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++
+       free(px->dyncookie_key);
+       px->dyncookie_key = newkey;
+-      for (s = px->srv; s != NULL; s = s->next)
++      for (s = px->srv; s != NULL; s = s->next) {
++              HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
+               srv_set_dyncookie(s);
++              HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
++      }
++
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
+       return 1;
+ }
+-/* Parses the "set maxconn frontend" directive, it always returns 1 */
++/* Parses the "set maxconn frontend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock.
++ */
+ static int cli_parse_set_maxconn_frontend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
+@@ -1675,6 +1708,8 @@ static int cli_parse_set_maxconn_frontend(char **args, struct appctx *appctx, vo
+       /* OK, the value is fine, so we assign it to the proxy and to all of
+        * its listeners. The blocked ones will be dequeued.
+        */
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++
+       px->maxconn = v;
+       list_for_each_entry(l, &px->conf.listeners, by_fe) {
+               l->maxconn = v;
+@@ -1685,10 +1720,15 @@ static int cli_parse_set_maxconn_frontend(char **args, struct appctx *appctx, vo
+       if (px->maxconn > px->feconn && !LIST_ISEMPTY(&px->listener_queue))
+               dequeue_all_listeners(&px->listener_queue);
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
++
+       return 1;
+ }
+-/* Parses the "shutdown frontend" directive, it always returns 1 */
++/* Parses the "shutdown frontend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock.
++ */
+ static int cli_parse_shutdown_frontend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
+@@ -1711,14 +1751,22 @@ static int cli_parse_shutdown_frontend(char **args, struct appctx *appctx, void
+                  px->id, px->fe_counters.cum_conn, px->be_counters.cum_conn);
+       send_log(px, LOG_WARNING, "Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
+                px->id, px->fe_counters.cum_conn, px->be_counters.cum_conn);
++
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
+       stop_proxy(px);
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
++
+       return 1;
+ }
+-/* Parses the "disable frontend" directive, it always returns 1 */
++/* Parses the "disable frontend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock.
++ */
+ static int cli_parse_disable_frontend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
++      int ret;
+       if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+               return 1;
+@@ -1741,7 +1789,11 @@ static int cli_parse_disable_frontend(char **args, struct appctx *appctx, void *
+               return 1;
+       }
+-      if (!pause_proxy(px)) {
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++      ret = pause_proxy(px);
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
++
++      if (!ret) {
+               appctx->ctx.cli.severity = LOG_ERR;
+               appctx->ctx.cli.msg = "Failed to pause frontend, check logs for precise cause.\n";
+               appctx->st0 = CLI_ST_PRINT;
+@@ -1750,10 +1802,14 @@ static int cli_parse_disable_frontend(char **args, struct appctx *appctx, void *
+       return 1;
+ }
+-/* Parses the "enable frontend" directive, it always returns 1 */
++/* Parses the "enable frontend" directive, it always returns 1.
++ *
++ * Grabs the proxy lock.
++ */
+ static int cli_parse_enable_frontend(char **args, struct appctx *appctx, void *private)
+ {
+       struct proxy *px;
++      int ret;
+       if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+               return 1;
+@@ -1776,7 +1832,11 @@ static int cli_parse_enable_frontend(char **args, struct appctx *appctx, void *p
+               return 1;
+       }
+-      if (!resume_proxy(px)) {
++      HA_SPIN_LOCK(PROXY_LOCK, &px->lock);
++      ret = resume_proxy(px);
++      HA_SPIN_UNLOCK(PROXY_LOCK, &px->lock);
++
++      if (!ret) {
+               appctx->ctx.cli.severity = LOG_ERR;
+               appctx->ctx.cli.msg = "Failed to resume frontend, check logs for precise cause (port conflict?).\n";
+               appctx->st0 = CLI_ST_PRINT;
diff --git a/net/haproxy/patches/0019-BUG-MEDIUM-cli-threads-protect-some-server-commands-against-concurrent-operations.patch b/net/haproxy/patches/0019-BUG-MEDIUM-cli-threads-protect-some-server-commands-against-concurrent-operations.patch
new file mode 100644 (file)
index 0000000..c69f874
--- /dev/null
@@ -0,0 +1,188 @@
+commit 0dbaa252df906cc9c1d0dc7a075c16e039ab1c5b
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Tue Aug 21 15:35:31 2018 +0200
+
+    BUG/MEDIUM: cli/threads: protect some server commands against concurrent operations
+    
+    The server-specific CLI commands "set weight", "set maxconn",
+    "disable agent", "enable agent", "disable health", "enable health",
+    "disable server" and "enable server" were not protected against
+    concurrent accesses. Now they take the server lock around the
+    sensitive part.
+    
+    This patch must be backported to 1.8.
+    
+    (cherry picked from commit 3bcc2699ba08dd3971ae7a56631994b2524d2acb)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/server.c b/src/server.c
+index 36a05e27..98dae535 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -4299,6 +4299,10 @@ static int cli_parse_get_weight(char **args, struct appctx *appctx, void *privat
+       return 1;
+ }
++/* Parse a "set weight" command.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_set_weight(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4311,16 +4315,24 @@ static int cli_parse_set_weight(char **args, struct appctx *appctx, void *privat
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
++
+       warning = server_parse_weight_change_request(sv, args[3]);
+       if (warning) {
+               appctx->ctx.cli.severity = LOG_ERR;
+               appctx->ctx.cli.msg = warning;
+               appctx->st0 = CLI_ST_PRINT;
+       }
++
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
++
+       return 1;
+ }
+-/* parse a "set maxconn server" command. It always returns 1. */
++/* parse a "set maxconn server" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_set_maxconn_server(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4333,16 +4345,24 @@ static int cli_parse_set_maxconn_server(char **args, struct appctx *appctx, void
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
++
+       warning = server_parse_maxconn_change_request(sv, args[4]);
+       if (warning) {
+               appctx->ctx.cli.severity = LOG_ERR;
+               appctx->ctx.cli.msg = warning;
+               appctx->st0 = CLI_ST_PRINT;
+       }
++
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
++
+       return 1;
+ }
+-/* parse a "disable agent" command. It always returns 1. */
++/* parse a "disable agent" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_disable_agent(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4354,11 +4374,16 @@ static int cli_parse_disable_agent(char **args, struct appctx *appctx, void *pri
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       sv->agent.state &= ~CHK_ST_ENABLED;
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
+-/* parse a "disable health" command. It always returns 1. */
++/* parse a "disable health" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_disable_health(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4370,11 +4395,16 @@ static int cli_parse_disable_health(char **args, struct appctx *appctx, void *pr
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       sv->check.state &= ~CHK_ST_ENABLED;
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
+-/* parse a "disable server" command. It always returns 1. */
++/* parse a "disable server" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_disable_server(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4386,11 +4416,16 @@ static int cli_parse_disable_server(char **args, struct appctx *appctx, void *pr
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       srv_adm_set_maint(sv);
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
+-/* parse a "enable agent" command. It always returns 1. */
++/* parse a "enable agent" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_enable_agent(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4409,11 +4444,16 @@ static int cli_parse_enable_agent(char **args, struct appctx *appctx, void *priv
+               return 1;
+       }
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       sv->agent.state |= CHK_ST_ENABLED;
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
+-/* parse a "enable health" command. It always returns 1. */
++/* parse a "enable health" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_enable_health(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4425,11 +4465,16 @@ static int cli_parse_enable_health(char **args, struct appctx *appctx, void *pri
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       sv->check.state |= CHK_ST_ENABLED;
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
+-/* parse a "enable server" command. It always returns 1. */
++/* parse a "enable server" command. It always returns 1.
++ *
++ * Grabs the server lock.
++ */
+ static int cli_parse_enable_server(char **args, struct appctx *appctx, void *private)
+ {
+       struct server *sv;
+@@ -4441,11 +4486,13 @@ static int cli_parse_enable_server(char **args, struct appctx *appctx, void *pri
+       if (!sv)
+               return 1;
++      HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
+       srv_adm_set_ready(sv);
+       if (!(sv->flags & SRV_F_COOKIESET)
+           && (sv->proxy->ck_opts & PR_CK_DYNAMIC) &&
+           sv->cookie)
+               srv_check_for_dup_dyncookie(sv);
++      HA_SPIN_UNLOCK(SERVER_LOCK, &sv->lock);
+       return 1;
+ }
diff --git a/net/haproxy/patches/0020-DOC-Fix-spelling-error-in-configuration-doc.patch b/net/haproxy/patches/0020-DOC-Fix-spelling-error-in-configuration-doc.patch
new file mode 100644 (file)
index 0000000..7871b93
--- /dev/null
@@ -0,0 +1,24 @@
+commit d13cb1516cb5ae4cb8322ed630e1d4e1f584fd77
+Author: Jens Bissinger <whiterabbit.init@googlemail.com>
+Date:   Thu Aug 23 14:11:27 2018 +0200
+
+    DOC: Fix spelling error in configuration doc
+    
+    Fix spelling error in logging section of configuration doc.
+    
+    (cherry picked from commit 15c64ff4fb9f1f64b31306ac53b38fc4d5fb1538)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/doc/configuration.txt b/doc/configuration.txt
+index 43e28785..0dd212ad 100644
+--- a/doc/configuration.txt
++++ b/doc/configuration.txt
+@@ -16089,7 +16089,7 @@ Please refer to the table below for currently defined variables :
+   |   | %t   | date_time      (with millisecond resolution)  | date        |
+   | H | %tr  | date_time of HTTP request                     | date        |
+   | H | %trg | gmt_date_time of start of HTTP request        | date        |
+-  | H | %trl | locla_date_time of start of HTTP request      | date        |
++  | H | %trl | local_date_time of start of HTTP request      | date        |
+   |   | %ts  | termination_state                             | string      |
+   | H | %tsc | termination_state with cookie status          | string      |
+   +---+------+-----------------------------------------------+-------------+
diff --git a/net/haproxy/patches/0021-BUG-MEDIUM-unix-provide-a---drain-function.patch b/net/haproxy/patches/0021-BUG-MEDIUM-unix-provide-a---drain-function.patch
new file mode 100644 (file)
index 0000000..95613f8
--- /dev/null
@@ -0,0 +1,57 @@
+commit f87ea7d2fdcfa3ccd5d605b3ce96642d28f20f6b
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Fri Aug 24 14:31:53 2018 +0200
+
+    BUG/MEDIUM: unix: provide a ->drain() function
+    
+    Right now conn_sock_drain() calls the protocol's ->drain() function if
+    it exists, otherwise it simply tries to disable polling for receiving
+    on the connection. This doesn't work well anymore since we've implemented
+    the muxes in 1.8, and it has a side effect with keep-alive backend
+    connections established over unix sockets. What happens is that if
+    during the idle time after a request, a connection reports some data,
+    si_idle_conn_null_cb() is called, which will call conn_sock_drain().
+    This one sees there's no drain() on unix sockets and will simply disable
+    polling for data on the connection. But it doesn't do anything on the
+    conn_stream. Thus while leaving the conn_fd_handler, the mux's polling
+    is updated and recomputed based on the conn_stream's polling state,
+    which is still enabled, and nothing changes, so we see the process
+    use 100% CPU in this case because the FD remains active in the cache.
+    
+    There are several issues that need to be addressed here. The first and
+    most important is that we cannot expect some protocols to simply stop
+    reading data when asked to drain pending data. So this patch make the
+    unix sockets rely on tcp_drain() since the functions are the same. This
+    solution is appropriate for backporting, but a better one is desired for
+    the long term. The second issue is that si_idle_conn_null_cb() shouldn't
+    drain the connection but the conn_stream.
+    
+    At the moment we don't have any way to drain a conn_stream, though a flag
+    on rcv_buf() will do it well. Until we support muxes on the server side
+    it is not a problem so this part can be addressed later.
+    
+    This fix must be backported to 1.8.
+    
+    (cherry picked from commit fe5d2ac65fd58a8320e8dc725219c1bce5839592)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/proto_uxst.c b/src/proto_uxst.c
+index f2374be6..0b3a57b8 100644
+--- a/src/proto_uxst.c
++++ b/src/proto_uxst.c
+@@ -42,6 +42,7 @@
+ #include <proto/listener.h>
+ #include <proto/log.h>
+ #include <proto/protocol.h>
++#include <proto/proto_tcp.h>
+ #include <proto/task.h>
+ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen);
+@@ -71,6 +72,7 @@ static struct protocol proto_unix = {
+       .disable_all = disable_all_listeners,
+       .get_src = uxst_get_src,
+       .get_dst = uxst_get_dst,
++      .drain = tcp_drain,
+       .pause = uxst_pause_listener,
+       .add = uxst_add_listener,
+       .listeners = LIST_HEAD_INIT(proto_unix.listeners),
diff --git a/net/haproxy/patches/0022-BUG-MINOR-lua-Bad-HTTP-client-request-duration.patch b/net/haproxy/patches/0022-BUG-MINOR-lua-Bad-HTTP-client-request-duration.patch
new file mode 100644 (file)
index 0000000..4985ac9
--- /dev/null
@@ -0,0 +1,56 @@
+commit 5b58c92dc9357a87aa3fe94c8121f683feb9c80e
+Author: Frédéric Lécaille <flecaille@haproxy.com>
+Date:   Wed Jul 18 14:25:26 2018 +0200
+
+    BUG/MINOR: lua: Bad HTTP client request duration.
+    
+    HTTP LUA applet callback should not update the date on which the HTTP client requests
+    arrive. This was done just after the LUA applet has completed its job.
+    
+    This patch simply removes the affected statement. The same fixe has been applied
+    to TCP LUA applet callback.
+    
+    To reproduce this issue, as reported by Patrick Hemmer, implement an HTTP LUA applet
+    which sleeps a bit before replying:
+    
+      core.register_service("foo", "http", function(applet)
+          core.msleep(100)
+          applet:set_status(200)
+          applet:start_response()
+      end)
+    
+    This had as a consequence to log %TR field with approximatively the same value as
+    the LUA sleep time.
+    
+    Thank you to Patrick Hemmer for having reported this issue.
+    
+    Must be backported to 1.8, 1.7 and 1.6.
+    
+    (cherry picked from commit 83ed5d58d2c767d03ce97aef484863a6e1c37a94)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/hlua.c b/src/hlua.c
+index daf775fc..8147ed15 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -6374,9 +6374,6 @@ static void hlua_applet_tcp_fct(struct appctx *ctx)
+       case HLUA_E_OK:
+               ctx->ctx.hlua_apptcp.flags |= APPLET_DONE;
+-              /* log time */
+-              strm->logs.tv_request = now;
+-
+               /* eat the whole request */
+               co_skip(si_oc(si), si_ob(si)->o);
+               res->flags |= CF_READ_NULL;
+@@ -6675,9 +6672,8 @@ static void hlua_applet_http_fct(struct appctx *ctx)
+               /* close the connection. */
+-              /* status / log */
++              /* status */
+               strm->txn->status = ctx->ctx.hlua_apphttp.status;
+-              strm->logs.tv_request = now;
+               /* eat the whole request */
+               co_skip(si_oc(si), si_ob(si)->o);
diff --git a/net/haproxy/patches/0023-BUG-MEDIUM-mux_pt-dereference-the-connection-with-care-in-mux_pt_wake.patch b/net/haproxy/patches/0023-BUG-MEDIUM-mux_pt-dereference-the-connection-with-care-in-mux_pt_wake.patch
new file mode 100644 (file)
index 0000000..6552f7e
--- /dev/null
@@ -0,0 +1,33 @@
+commit d9a130e1962c2a5352f33088c563f4248a102c48
+Author: Willy Tarreau <w@1wt.eu>
+Date:   Fri Aug 24 15:48:59 2018 +0200
+
+    BUG/MEDIUM: mux_pt: dereference the connection with care in mux_pt_wake()
+    
+    mux_pt_wake() calls data->wake() which can return -1 indicating that the
+    connection was just destroyed. We need to check for this condition and
+    immediately exit in this case otherwise we dereference a just freed
+    connection. Note that this mainly happens on idle connections between
+    two HTTP requests. It can have random implications between requests as
+    it may lead a wrong connection's polling to be re-enabled or disabled
+    for example, especially with threads.
+    
+    This patch must be backported to 1.8.
+    
+    (cherry picked from commit ad7f0ad1c3c9c541a4c315b24d4500405d1383ee)
+    Signed-off-by: Willy Tarreau <w@1wt.eu>
+
+diff --git a/src/mux_pt.c b/src/mux_pt.c
+index a68b9621..c43e30f2 100644
+--- a/src/mux_pt.c
++++ b/src/mux_pt.c
+@@ -51,6 +51,9 @@ static int mux_pt_wake(struct connection *conn)
+       ret = cs->data_cb->wake ? cs->data_cb->wake(cs) : 0;
++      if (ret < 0)
++              return ret;
++
+       /* If we had early data, and we're done with the handshake
+        * then whe know the data are safe, and we can remove the flag.
+        */
index 3a8e754040ccca80692a6b5605d00c038c4c614c..6e9f8e1cdc1df94719d965fc01e7f7351fe71d54 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https_dns_proxy
 PKG_VERSION:=2018-04-23
-PKG_RELEASE=1
+PKG_RELEASE=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_MIRROR_HASH:=24b7e4238c37e646f33eee3a374f6b7beb5c167b9c5008cc13b51e5f1f3a44ea
index b124aeb9ddff97ed53d9295f4e8e97285c600782..b5b49ba66ee855e317b5da25352f9c27ba9cfc53 100644 (file)
@@ -1,8 +1,19 @@
 config https_dns_proxy
        option listen_addr '127.0.0.1'
        option listen_port '5053'
+       option bootstrap_dns '8.8.8.8,8.8.4.4'
+       option url_prefix 'https://dns.google.com/resolve?'
+       option user 'nobody'
+       option group 'nogroup'
+       option subnet_addr ''
+       option proxy_server ''
+
+config https_dns_proxy
+       option listen_addr '127.0.0.1'
+       option listen_port '5054'
+       option bootstrap_dns '1.1.1.1,1.0.0.1'
+       option url_prefix 'https://cloudflare-dns.com/dns-query?ct=application/dns-json&'
        option user 'nobody'
        option group 'nogroup'
        option subnet_addr ''
        option proxy_server ''
-       option url_prefix 'https://dns.google.com/resolve?'
index 9a5f797925f085ee9599a5c939a46782b67f2ac9..645c17aa46ca263d79f81e2327330b21eaea5824 100644 (file)
@@ -1,39 +1,37 @@
 #!/bin/sh /etc/rc.common
 
 START=80
-
 USE_PROCD=1
-PROG=/usr/sbin/https_dns_proxy
-
-start_instance() {
-       local cfg="$1"
-       local listen_addr listen_port user group
 
-       config_get listen_addr "$cfg" listen_addr
-       config_get listen_port "$cfg" listen_port
-       config_get user "$cfg" user
-       config_get group "$cfg" group
-       config_get subnet_addr "$cfg" subnet_addr
-       config_get proxy_server "$cfg" proxy_server
-       config_get url_prefix "$cfg" url_prefix
+PROG=/usr/sbin/https_dns_proxy
 
-       if [ -n "$subnet_addr" ]; then
-               subnet_param="-e $subnet_addr"
-       fi
+xappend() { param="$param $1"; }
+
+append_parm() {
+       local section="$1"
+       local option="$2"
+       local switch="$3"
+       local default="$4"
+       local _loctmp
+       config_get _loctmp "$section" "$option" "$default"
+       [ -z "$_loctmp" ] && return 0
+       xappend "$switch $_loctmp"
+}
 
-       if [ -n "$proxy_server" ]; then
-               proxy_param="-t $proxy_server"
-       fi
+start_instance() {
+       local cfg="$1" param
 
-       if [ -z "$url_prefix" ]; then
-               url_prefix="https://dns.google.com/resolve?"
-       fi
+       append_parm "$cfg" 'listen_addr' '-a' '127.0.0.1'
+       append_parm "$cfg" 'listen_port' '-p' '5053'
+       append_parm "$cfg" 'bootstrap_dns' '-b'
+       append_parm "$cfg" 'url_prefix' '-r'
+       append_parm "$cfg" 'user' '-u' 'nobody'
+       append_parm "$cfg" 'group' '-g' 'nogroup'
+       append_parm "$cfg" 'subnet_addr' '-e'
+       append_parm "$cfg" 'proxy_server' '-t'
 
        procd_open_instance
-       procd_set_param command ${PROG} \
-               -a "$listen_addr" -p "$listen_port" \
-               -u "$user" -g "$group" $subnet_param $proxy_param \
-               -r "$url_prefix"
+       procd_set_param command ${PROG} ${param}
        procd_set_param respawn
        procd_close_instance
 }
index b9fbe3ae6ee8672dab9e00a8995007c1cd113c67..97a97f542a34348cc5eca3a8363fb72bf3b2dfdf 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=i2pd
-PKG_VERSION:=2.19.0
+PKG_VERSION:=2.20.0
 PKG_RELEASE:=1
 PKG_BUILD_PARALLEL:=1
 
 PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=7202497ffc3db632d0f7fed93eafaf39aa75efea199705dae7d022249b069eb9
+PKG_HASH:=e424c368f92be5050f3dd5e98ed9ce2ea8d6076e36444c99b96e3b10f69420b1
 PKG_LICENSE:=BSD-3-clause
 
 include $(INCLUDE_DIR)/package.mk
index 940846b5ca4beae37d3ec3e7065f81530e136e0b..9878391123faf16c69fd4196dca4db65fcb403ab 100644 (file)
@@ -5,28 +5,26 @@
 # See /LICENSE for more information.
 
 include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=jool
-PKG_VERSION:=2018.01.17
-PKG_RELEASE:=2
+PKG_VERSION:=3.5.7
+PKG_RELEASE:=1
 
-PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILES:=COPYING
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/NICMx/Jool/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=b8e95d1526cd2434dedbae292afd2d17f0780ac2dca2be21264712b41eb76a3d
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/Jool-$(PKG_VERSION)
 
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/NICMx/Jool.git
-PKG_SOURCE_VERSION:=9dfaf22e49f7905d94af9b73f9bee22c26d7dd4a
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MIRROR_HASH:=79b558561f06f3df01a541b1d39b7d3d88f91d0ee6b8ce3abf91ebbed737225a
+PKG_MAINTAINER:=Dan Luedtke <mail@danrl.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
-PKG_BUILD_DIR=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
 
 PKG_FIXUP:=autoreconf
 
-include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/package.mk
 
 MAKE_PATH:=usr
@@ -54,7 +52,6 @@ define Package/jool/Default
   SECTION:=net
   CATEGORY:=Network
   URL:=https://www.jool.mx
-  MAINTAINER:=Dan Luedtke <mail@danrl.com>
 endef
 
 define Package/jool/Default/description
index e4cae206ce0acc3ee7cc85032970667391323eb6..10ef3f8991d0ba0597aaf29805fd19bd4efe6a54 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=keepalived
-PKG_VERSION:=1.4.4
+PKG_VERSION:=2.0.7
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.keepalived.org/software
-PKG_HASH:=147c2b3b782223128551fd0a1564eaa30ed84a94b68c50ec5087747941314704
+PKG_HASH:=bce45d6d5cf3620bfd88472ec839a75b5a14a54fda12d09e890670244873b8ab
 
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
@@ -36,7 +36,11 @@ define Package/keepalived
     +libip4tc \
     +IPV6:libip6tc \
     +libxtables \
-    +kmod-macvlan
+    +kmod-macvlan \
+    +libmagic \
+    +libnl-route \
+    +libnfnetlink \
+    +kmod-nf-ipvs
 endef
 
 define Package/keepalived/description
@@ -51,8 +55,6 @@ endef
 
 CONFIGURE_ARGS+= \
        --enable-sha1 \
-       --disable-lvs \
-       --disable-lvs-syncd \
        --disable-snmp \
        --with-kernel-dir="$(LINUX_DIR)/$(LINUX_UAPI_DIR)"
 
diff --git a/net/keepalived/patches/0001-Include-stdbool.h-in-process.c.patch b/net/keepalived/patches/0001-Include-stdbool.h-in-process.c.patch
new file mode 100644 (file)
index 0000000..733f6ab
--- /dev/null
@@ -0,0 +1,25 @@
+From 6c7a281473083f7ac47b426b2127a8c8e76caca5 Mon Sep 17 00:00:00 2001
+From: Quentin Armitage <quentin@armitage.org.uk>
+Date: Sat, 25 Aug 2018 11:36:11 +0100
+Subject: [PATCH] Include stdbool.h in process.c
+
+Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
+---
+ keepalived/core/process.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/keepalived/core/process.c b/keepalived/core/process.c
+index f11c32a3..22bcf254 100644
+--- a/keepalived/core/process.c
++++ b/keepalived/core/process.c
+@@ -30,6 +30,7 @@
+ #ifdef _HAVE_SCHED_RT_
+ #include <sched.h>
+ #endif
++#include <stdbool.h>
+ #include "process.h"
+ #include "logger.h"
+-- 
+2.11.0
+
index 5e366e3619413912d5b76dd233eb309a34f80835..22388ab507e32490b45a3ad416a66df7b95d16eb 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=krb5
 PKG_VERSION:=1.16.1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
 
@@ -71,7 +71,8 @@ CONFIGURE_VARS += \
        ac_cv_func_regcomp=yes \
        ac_cv_printf_positional=yes \
        ac_cv_file__etc_environment=no \
-       ac_cv_file__etc_TIMEZONE=no
+       ac_cv_file__etc_TIMEZONE=no \
+       ac_cv_header_keyutils_h=no
 
 CONFIGURE_ARGS += \
        --localstatedir=/etc \
index f0a80461eecd43f2b6d8180b5e9811e353252dec..f2ed10365666941897611b2792033c606f6027a9 100644 (file)
@@ -197,6 +197,15 @@ define Build/InstallDev
        $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
        $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
        $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_BUILD_DIR)/libmosquitto.pc.in $(1)/usr/lib/pkgconfig/libmosquitto.pc
+       sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
+              -e "s#@VERSION@#$(PKG_VERSION)#" \
+           $(1)/usr/lib/pkgconfig/libmosquitto.pc
+       $(CP) $(PKG_BUILD_DIR)/libmosquittopp.pc.in $(1)/usr/lib/pkgconfig/libmosquittopp.pc
+       sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
+              -e "s#@VERSION@#$(PKG_VERSION)#" \
+           $(1)/usr/lib/pkgconfig/libmosquittopp.pc
 endef
 
 # This installs files on the target.  Compare with Build/InstallDev
index 9435b1354d816549ffb0bdfc5f17594ee0fedadd..67921de4c776b85e65ab1cebb43f83e15ee37307 100644 (file)
@@ -9,14 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mtr
 PKG_VERSION:=0.92
-PKG_RELEASE:=2
-
-PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/traviscross/mtr/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=568a52911a8933496e60c88ac6fea12379469d7943feb9223f4337903e4bc164
+PKG_SOURCE_URL:=https://www.bitwizard.nl/mtr/files
+PKG_HASH:=f2979db9e2f41aa8e6574e7771767c9afe111d9213814eb47f5e1e71876e4382
 
+PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 PKG_LICENSE:=GPL-2.0+
 PKG_LICENSE_FILES:=COPYING
 
@@ -50,10 +49,7 @@ CONFIGURE_ARGS += \
        --without-gtk \
        $(call autoconf_bool,CONFIG_IPV6,ipv6)
 
-define Build/Configure
-       echo $(PKG_VERSION) > .tarball-version
-       $(call Build/Configure/Default)
-endef
+CONFIGURE_VARS += ac_cv_lib_cap_cap_set_proc=no
 
 define Package/mtr/install
        $(INSTALL_DIR) $(1)/usr/sbin
diff --git a/net/mtr/patches/010-remove-libcap-support.patch b/net/mtr/patches/010-remove-libcap-support.patch
deleted file mode 100644 (file)
index db15a51..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index a08ce67..83bf094 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -106,10 +106,6 @@ AS_IF([test "x$with_ncurses" = "xyes"],
- ])
- AM_CONDITIONAL([WITH_CURSES], [test "x$with_ncurses" = xyes])
--AC_CHECK_LIB([cap], [cap_set_proc], [],
--  AS_IF([test "$host_os" = linux-gnu],
--    AC_MSG_WARN([Capabilities support is strongly recommended for increased security.  See SECURITY for more information.])))
--
- # Enable ipinfo
- AC_ARG_WITH([ipinfo],
-   [AS_HELP_STRING([--without-ipinfo], [Do not try to use ipinfo lookup at all])],
diff --git a/net/mtr/patches/020-Sami-Kerola-prevent-MTR-reporting-unknown-revision.patch b/net/mtr/patches/020-Sami-Kerola-prevent-MTR-reporting-unknown-revision.patch
deleted file mode 100644 (file)
index 4923d72..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 94218682b15832fd6f8ed09a767941974075a1b4 Mon Sep 17 00:00:00 2001
-From: "R.E. Wolff" <R.E.Wolff@BitWizard.nl>
-Date: Tue, 7 Nov 2017 17:24:14 +0100
-Subject: [PATCH] Sami Kerola: prevent MTR reporting unknown revision
-
----
- Makefile.am | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/Makefile.am b/Makefile.am
-index c0709ca..23ac1fc 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -156,3 +156,7 @@ endif  # if CYGWIN
- if BUILD_BASH_COMPLETION
- dist_bashcompletion_DATA = bash-completion/mtr
- endif
-+
-+dist-hook:
-+      $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
-+
--- 
-2.17.1
-
index adb54b24ae08cc29ca7b73a52022eac00d057bcc..0ed7488a705c43f762049b9aad3a0d0a041eb927 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mwan3
-PKG_VERSION:=2.6.18
+PKG_VERSION:=2.7.1
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
 PKG_LICENSE:=GPLv2
index b7f6c2c11ba27b86629444b0cd9ed458f85cdf80..966601eee2dd1e78ad0051e6613cb5ede01cc6cc 100644 (file)
@@ -1,7 +1,8 @@
 
 config globals 'globals'
        option mmx_mask '0x3F00'
-       option local_source 'lan'
+       option local_source 'none'
+       option rtmon_interval '5'
 
 config interface 'wan'
        option enabled '1'
diff --git a/net/mwan3/files/etc/hotplug.d/iface/16-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/16-mwan3
new file mode 100644 (file)
index 0000000..d2d148b
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/network.sh
+. /lib/mwan3/mwan3.sh
+
+config_load mwan3
+config_get_bool enabled globals 'enabled' '0'
+[ ${enabled} -gt 0 ] || exit 0
+
+if [ "$ACTION" == "ifup" ]; then
+       mwan3_lock
+       mwan3_rtmon
+       mwan3_unlock
+fi
+
+exit 0
index 2c5bbf3c126e9a10e5f7122dbc41916b46c30245..541e64d248284e1302f1ddb1f369507b0a7570fa 100644 (file)
@@ -20,6 +20,63 @@ MM_BLACKHOLE=""
 MMX_UNREACHABLE=""
 MM_UNREACHABLE=""
 
+mwan3_rtmon_ipv4()
+{
+       local tid=1
+       local idx=0
+       local ret=1
+       mkdir -p /tmp/mwan3rtmon
+       ($IP4 route list table main  | grep -v ^default | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.main
+       while uci get mwan3.@interface[$idx] >/dev/null 2>&1 ; do
+               idx=$((idx+1))
+               tid=$idx
+               [ "$(uci get mwan3.@interface[$((idx-1))].family)" = "ipv4" ] && {
+                       if $IP4 route list table $tid | grep -q ^default; then
+                               ($IP4 route list table $tid  | grep -v ^default | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv4.$tid
+                               cat /tmp/mwan3rtmon/ipv4.$tid | grep -v -x -F -f /tmp/mwan3rtmon/ipv4.main | while read line; do
+                                       $IP4 route del table $tid $line
+                               done
+                               cat /tmp/mwan3rtmon/ipv4.main | grep -v -x -F -f /tmp/mwan3rtmon/ipv4.$tid | while read line; do
+                                       $IP4 route add table $tid $line
+                               done
+                       fi
+               }
+               if [ "$(uci get mwan3.@interface[$((idx-1))].enabled)" = "1" ]; then
+                       ret=0
+               fi
+       done
+       rm -f /tmp/mwan3rtmon/ipv4.*
+       return $ret
+}
+
+mwan3_rtmon_ipv6()
+{
+       local tid=1
+       local idx=0
+       local ret=1
+       mkdir -p /tmp/mwan3rtmon
+       ($IP6 route list table main  | grep -v "^default\|^::/0\|^unreachable" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv6.main
+       while uci get mwan3.@interface[$idx] >/dev/null 2>&1 ; do
+               idx=$((idx+1))
+               tid=$idx
+               [ "$(uci get mwan3.@interface[$((idx-1))].family)" = "ipv6" ] && {
+                       if $IP6 route list table $tid | grep -q "^default\|^::/0"; then
+                               ($IP6 route list table $tid  | grep -v "^default\|^::/0\|^unreachable" | sort -n; echo empty fixup) >/tmp/mwan3rtmon/ipv6.$tid
+                               cat /tmp/mwan3rtmon/ipv6.$tid | grep -v -x -F -f /tmp/mwan3rtmon/ipv6.main | while read line; do
+                                       $IP6 route del table $tid $line
+                               done
+                               cat /tmp/mwan3rtmon/ipv6.main | grep -v -x -F -f /tmp/mwan3rtmon/ipv6.$tid | while read line; do
+                                       $IP6 route add table $tid $line
+                               done
+                       fi
+               }
+               if [ "$(uci get mwan3.@interface[$((idx-1))].enabled)" = "1" ]; then
+                       ret=0
+               fi
+       done
+       rm -f /tmp/mwan3rtmon/ipv6.*
+       return $ret
+}
 
 # counts how many bits are set to 1
 # n&(n-1) clears the lowest bit set to 1
@@ -188,10 +245,6 @@ mwan3_set_general_iptables()
                        $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
                fi
 
-               if ! $IPT -S mwan3_ifaces_out &> /dev/null; then
-                       $IPT -N mwan3_ifaces_out
-               fi
-
                if ! $IPT -S mwan3_rules &> /dev/null; then
                        $IPT -N mwan3_rules
                fi
@@ -209,7 +262,6 @@ mwan3_set_general_iptables()
                        $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
                        $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_in
                        $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_connected
-                       $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_out
                        $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_rules
                        $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
                        $IPT -A mwan3_hook -m mark ! --mark $MMX_DEFAULT/$MMX_MASK -j mwan3_connected
@@ -241,30 +293,16 @@ mwan3_create_iface_iptables()
                        $IPT4 -N mwan3_ifaces_in
                fi
 
-               if ! $IPT4 -S mwan3_ifaces_out &> /dev/null; then
-                       $IPT4 -N mwan3_ifaces_out
-               fi
-
                if ! $IPT4 -S mwan3_iface_in_$1 &> /dev/null; then
                        $IPT4 -N mwan3_iface_in_$1
                fi
 
-               if ! $IPT4 -S mwan3_iface_out_$1 &> /dev/null; then
-                       $IPT4 -N mwan3_iface_out_$1
-               fi
-
                $IPT4 -F mwan3_iface_in_$1
                $IPT4 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
                $IPT4 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
                $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT4 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
-
-               $IPT4 -F mwan3_iface_out_$1
-               $IPT4 -A mwan3_iface_out_$1 -o $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
-
-               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
-               $IPT4 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
        fi
 
        if [ "$family" == "ipv6" ]; then
@@ -274,30 +312,16 @@ mwan3_create_iface_iptables()
                        $IPT6 -N mwan3_ifaces_in
                fi
 
-               if ! $IPT6 -S mwan3_ifaces_out &> /dev/null; then
-                       $IPT6 -N mwan3_ifaces_out
-               fi
-
                if ! $IPT6 -S mwan3_iface_in_$1 &> /dev/null; then
                        $IPT6 -N mwan3_iface_in_$1
                fi
 
-               if ! $IPT6 -S mwan3_iface_out_$1 &> /dev/null; then
-                       $IPT6 -N mwan3_iface_out_$1
-               fi
-
                $IPT6 -F mwan3_iface_in_$1
                $IPT6 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected_v6 src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
                $IPT6 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
 
                $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT6 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
-
-               $IPT6 -F mwan3_iface_out_$1
-               $IPT6 -A mwan3_iface_out_$1 -o $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
-
-               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
-               $IPT6 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
        fi
 }
 
@@ -310,10 +334,6 @@ mwan3_delete_iface_iptables()
                $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT4 -F mwan3_iface_in_$1 &> /dev/null
                $IPT4 -X mwan3_iface_in_$1 &> /dev/null
-
-               $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
-               $IPT4 -F mwan3_iface_out_$1 &> /dev/null
-               $IPT4 -X mwan3_iface_out_$1 &> /dev/null
        fi
 
        if [ "$family" == "ipv6" ]; then
@@ -321,10 +341,6 @@ mwan3_delete_iface_iptables()
                $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
                $IPT6 -F mwan3_iface_in_$1 &> /dev/null
                $IPT6 -X mwan3_iface_in_$1 &> /dev/null
-
-               $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
-               $IPT6 -F mwan3_iface_out_$1 &> /dev/null
-               $IPT6 -X mwan3_iface_out_$1 &> /dev/null
        fi
 }
 
@@ -352,6 +368,7 @@ mwan3_create_iface_route()
 
                $IP4 route flush table $id
                $IP4 route add table $id default $route_args dev $2
+               mwan3_rtmon_ipv4
        fi
 
        if [ "$family" == "ipv6" ]; then
@@ -369,6 +386,7 @@ mwan3_create_iface_route()
 
                $IP6 route flush table $id
                $IP6 route add table $id default $route_args dev $2
+               mwan3_rtmon_ipv6
        fi
 }
 
@@ -409,7 +427,7 @@ mwan3_create_iface_rules()
                        $IP4 rule del pref $(($id+2000))
                done
 
-               $IP4 rule add pref $(($id+1000)) iif $2 lookup main
+               $IP4 rule add pref $(($id+1000)) iif $2 lookup $id
                $IP4 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
        fi
 
@@ -423,7 +441,7 @@ mwan3_create_iface_rules()
                        $IP6 rule del pref $(($id+2000))
                done
 
-               $IP6 rule add pref $(($id+1000)) iif $2 lookup main
+               $IP6 rule add pref $(($id+1000)) iif $2 lookup $id
                $IP6 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
        fi
 }
@@ -475,6 +493,16 @@ mwan3_delete_iface_ipset_entries()
        done
 }
 
+mwan3_rtmon()
+{
+       pid="$(pgrep -f mwan3rtmon)"
+       if [ "${pid}" != "" ]; then
+               kill -USR1 "${pid}"
+       else
+               [ -x /usr/sbin/mwan3rtmon ] && /usr/sbin/mwan3rtmon &
+       fi
+}
+
 mwan3_track()
 {
        local track_ip track_ips pid
@@ -507,13 +535,14 @@ mwan3_track_signal()
 
 mwan3_set_policy()
 {
-       local iface_count id iface family metric probability weight
+       local iface_count id iface family metric probability weight device
 
        config_get iface $1 interface
        config_get metric $1 metric 1
        config_get weight $1 weight 1
 
        [ -n "$iface" ] || return 0
+       network_get_device device $iface
        [ "$metric" -gt $DEFAULT_LOWEST_METRIC ] && $LOG warn "Member interface $iface has >$DEFAULT_LOWEST_METRIC metric. Not appending to policy" && return 0
 
        mwan3_get_iface_id id $iface
@@ -552,6 +581,11 @@ mwan3_set_policy()
 
                                $IPT4 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v4" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                        fi
+               else
+                       [ -n "$device" ] && {
+                               $IPT4 -S mwan3_policy_$policy | grep -q '.*--comment ".* [0-9]* [0-9]*"' || \
+                                       $IPT4 -I mwan3_policy_$policy -o $device -m mark --mark 0x0/$MMX_MASK -m comment --comment "out $iface $device" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+                       }
                fi
        fi
 
@@ -585,6 +619,11 @@ mwan3_set_policy()
 
                                $IPT6 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v6" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                        fi
+               else
+                       [ -n "$device" ] && {
+                               $IPT6 -S mwan3_policy_$policy | grep -q '.*--comment ".* [0-9]* [0-9]*"' || \
+                                       $IPT6 -I mwan3_policy_$policy -o $device -m mark --mark 0x0/$MMX_MASK -m comment --comment "out $iface $device" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+                       }
                fi
        fi
 }
@@ -649,7 +688,7 @@ mwan3_set_sticky_iptables()
                        [ -n "$id" ] || return 0
 
                        for IPT in "$IPT4" "$IPT6"; do
-                               if [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" ]; then
+                               if [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" ]; then
                                        $IPT -I mwan3_rule_$rule -m mark --mark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/$MMX_MASK
                                        $IPT -I mwan3_rule_$rule -m mark --mark 0/$MMX_MASK -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
                                fi
@@ -822,9 +861,9 @@ mwan3_report_iface_status()
 
        if [ -z "$id" -o -z "$device" ]; then
                result="unknown"
-       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
                result="$(mwan3_get_iface_hotplug_state $1)"
-       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -o -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -o -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -o -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -o -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+       elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -o -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -o -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -o -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
                result="error"
        elif [ "$enabled" == "1" ]; then
                result="offline"
@@ -858,16 +897,16 @@ mwan3_report_policies_v4()
        for policy in $($IPT4 -S | awk '{print $2}' | grep mwan3_policy_ | sort -u); do
                echo "$policy:" | sed 's/mwan3_policy_//'
 
-               [ -n "$total_weight" ] || total_weight=$($IPT4 -S $policy | cut -s -d'"' -f2 | head -1 | awk '{print $3}')
+               [ -n "$total_weight" ] || total_weight=$($IPT4 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | head -1 | awk '{print $3}')
 
                if [ ! -z "${total_weight##*[!0-9]*}" ]; then
-                       for iface in $($IPT4 -S $policy | cut -s -d'"' -f2 | awk '{print $1}'); do
-                               weight=$($IPT4 -S $policy | cut -s -d'"' -f2 | awk '$1 == "'$iface'"' | awk '{print $2}')
+                       for iface in $($IPT4 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | awk '{print $1}'); do
+                               weight=$($IPT4 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | awk '$1 == "'$iface'"' | awk '{print $2}')
                                percent=$(($weight*100/$total_weight))
                                echo " $iface ($percent%)"
                        done
                else
-                       echo " $($IPT4 -S $policy | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
+                       echo " $($IPT4 -S $policy | grep -v '.*--comment "out .*" .*$' | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
                fi
 
                unset total_weight
@@ -883,16 +922,16 @@ mwan3_report_policies_v6()
        for policy in $($IPT6 -S | awk '{print $2}' | grep mwan3_policy_ | sort -u); do
                echo "$policy:" | sed 's/mwan3_policy_//'
 
-               [ -n "$total_weight" ] || total_weight=$($IPT6 -S $policy | cut -s -d'"' -f2 | head -1 | awk '{print $3}')
+               [ -n "$total_weight" ] || total_weight=$($IPT6 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | head -1 | awk '{print $3}')
 
                if [ ! -z "${total_weight##*[!0-9]*}" ]; then
-                       for iface in $($IPT6 -S $policy | cut -s -d'"' -f2 | awk '{print $1}'); do
-                               weight=$($IPT6 -S $policy | cut -s -d'"' -f2 | awk '$1 == "'$iface'"' | awk '{print $2}')
+                       for iface in $($IPT6 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | awk '{print $1}'); do
+                               weight=$($IPT6 -S $policy | grep -v '.*--comment "out .*" .*$' | cut -s -d'"' -f2 | awk '$1 == "'$iface'"' | awk '{print $2}')
                                percent=$(($weight*100/$total_weight))
                                echo " $iface ($percent%)"
                        done
                else
-                       echo " $($IPT6 -S $policy | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
+                       echo " $($IPT6 -S $policy | grep -v '.*--comment "out .*" .*$' | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
                fi
 
                unset total_weight
index a0c296f18e2bc0ea2acce0787163a596723a044f..c10ffa8a53a6d9542cba2d5c1bbaa996d482907b 100755 (executable)
@@ -155,6 +155,12 @@ stop()
 {
        local ipset route rule table IP IPT pid src_ip
 
+       for pid in $(pgrep -f "mwan3rtmon"); do
+               kill -TERM "$pid" > /dev/null 2>&1
+               sleep 1
+               kill -KILL "$pid" > /dev/null 2>&1
+       done
+
        for pid in $(pgrep -f "mwan3track"); do
                kill -TERM "$pid" > /dev/null 2>&1
                sleep 1
diff --git a/net/mwan3/files/usr/sbin/mwan3rtmon b/net/mwan3/files/usr/sbin/mwan3rtmon
new file mode 100755 (executable)
index 0000000..667d0cc
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/mwan3/mwan3.sh
+
+LOG="logger -t $(basename "$0")[$$] -p"
+
+clean_up() {
+       $LOG notice "Stopping mwan3rtmon..."
+       exit 0
+}
+
+rtchange() {
+       $LOG info "Detect rtchange event."
+}
+
+main() {
+       local rtmon_interval
+       trap clean_up TERM
+       trap rtchange USR1
+
+       config_load mwan3
+       config_get rtmon_interval globals rtmon_interval '5'
+
+       sleep 3
+       while mwan3_rtmon_ipv4 || mwan3_rtmon_ipv6; do
+               [ "$rtmon_interval" = "0" ] && break
+               sleep $rtmon_interval
+       done
+}
+
+main "$@"
index de88938f28501829721555147a8a050ee13db418..dcb98d0292164bda25433d0e43e9618fe30d3c0a 100644 (file)
@@ -7,12 +7,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nfs-kernel-server
-PKG_VERSION:=2.3.2
+PKG_VERSION:=2.3.3
 PKG_RELEASE:=2
-PKG_HASH:=1748a046e452ceb2285cc07b61ec0f85af7c92ac443e111a6c8a1061254ca717
+PKG_HASH:=3c8c63611c7e78b7a3b2f8a28b9928a5b5e66d5e9ad09a1e54681508884320a4
 
 PKG_SOURCE_URL:=@SF/nfs
-PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.xz
 
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/nfs-utils-$(PKG_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/nfs-utils-$(PKG_VERSION)
@@ -95,6 +95,7 @@ endif
 CONFIGURE_VARS += \
        libblkid_cv_is_recent=yes \
        ac_cv_lib_resolv___res_querydomain=yes \
+       ac_cv_lib_bsd_daemon=no \
        CONFIG_SQLITE3_TRUE="\#" \
        CONFIG_NFSDCLD_TRUE="\#"
 
index c0a7a1c73660dac03f3a8e53789c69e88c4b915e..b25897df46a0b25a910941f6b980ae882d05f54c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
-PKG_VERSION:=1.15.2
-PKG_RELEASE:=4
+PKG_VERSION:=1.15.3
+PKG_RELEASE:=1
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://nginx.org/download/
-PKG_HASH:=eeba09aecfbe8277ac33a5a2486ec2d6731739f3c1c701b42a0c3784af67ad90
+PKG_HASH:=9391fb91c3e2ebd040a4e3ac2b2f0893deb6232edc30a8e16fcc9c3fa9d6be85
 
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de> \
                                Ansuel Smith <ansuelsmth@gmail.com>
index 2a253f8c0849b76dde0d6120801c161d8b0ed60a..6108e27056b058b2d615b2abce5f4e8333387ff2 100644 (file)
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nut
 PKG_VERSION:=2.7.4
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
 PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7
 PKG_MAINTAINER:=Daniel Dickinson <cshored@thecshore.com>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=LICENSE-GPL2
+PKG_LICENSE:=GPL-2.0+ GPL-3.0+ GPL-1.0+ Artistic-1.0-Perl
+PKG_LICENSE_FILES:=LICENSE-GPL2 LICENSE-GPL3 COPYING
 PKG_FIXUP:=autoreconf
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@@ -63,22 +63,32 @@ define Package/nut/install
 endef
 
 define Package/nut-server/install
+       # Server portion
        $(INSTALL_DIR) $(1)/etc/nut
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_DIR) $(1)/usr/share/nut
-       $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/nut-server.init $(1)/etc/init.d/nut-server
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/nut_server $(1)/etc/config/nut_server
-       ln -sf /var/etc/nut/nut.conf $(1)/etc/nut/nut.conf
-       ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf
        ln -sf /var/etc/nut/upsd.users  $(1)/etc/nut/upsd.users
        ln -sf /var/etc/nut/upsd.conf $(1)/etc/nut/upsd.conf
+       # Driver common portion
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsdrvctl $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/
+       ln -sf /var/etc/nut/ups.conf $(1)/etc/nut/ups.conf
+       # Mangle libhid.usermap into a format (hotplug shell script) useful for OpenWrt
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+       $(INSTALL_BIN) ./files/30-libhid-ups.head $(1)/etc/hotplug.d/usb/30-libhid-ups
+       $(CP) $(PKG_INSTALL_DIR)/etc/hotplug/usb/libhid.usermap $(PKG_BUILD_DIR)/30-libhid-ups.middle
+       $(SED) '/^$$$$/d' \
+               -e '/^#/d' \
+               -E -e 's:^[^ ][^ ]*  *0x0003  *0x0{0,3}([^ ][^ ]*)  *0x{0,3}*([^ ][^ ]*).*:\1/\2/* | \\:' \
+               $(PKG_BUILD_DIR)/30-libhid-ups.middle
+       tail -n+2 $(PKG_BUILD_DIR)/30-libhid-ups.middle >>$(1)/etc/hotplug.d/usb/30-libhid-ups
+       cat ./files/30-libhid-ups.tail >>$(1)/etc/hotplug.d/usb/30-libhid-ups
 endef
 
 define Package/nut-common
@@ -87,8 +97,7 @@ define Package/nut-common
        DEPENDS:= nut \
                +NUT_DRIVER_SNMP:libnetsnmp \
                +NUT_DRIVER_USB:libusb-compat \
-               +NUT_SSL:libopenssl \
-               +PACKAGE_libwrap:libwrap
+               +NUT_SSL:libopenssl
 endef
 
 define Package/nut-common/description
@@ -96,6 +105,10 @@ $(call Package/nut/description/Default)
 This package contains the common files.
 endef
 
+define Package/nut-common/conffiles
+/etc/nut/nut.conf
+endef
+
 define Package/nut-common/install
        $(INSTALL_DIR) $(1)/etc/nut
        $(INSTALL_DIR) $(1)/usr/lib
@@ -107,6 +120,7 @@ define Package/nut-server
        $(call Package/nut/Default)
        TITLE+= (server)
        DEPENDS:=nut +nut-common
+       USERID:=nut=113:nut=113
 endef
 
 define Package/nut-server/description
@@ -120,13 +134,16 @@ endef
 
 define Package/nut-server/conffiles
 /etc/config/nut_server
+/etc/nut/upsd.conf
+/etc/nut/upsd.users
+/etc/nut/ups.conf
 endef
 
 define Package/nut-upsmon
   $(call Package/nut/Default)
        TITLE+= (monitor)
        DEPENDS:=nut +nut-common
-       USERID:=nut=113:nut=113
+       USERID:=nutmon=114:nutmon=114
 endef
 
 define Package/nut-upsmon/description
@@ -141,6 +158,7 @@ endef
 
 define Package/nut-upsmon/conffiles
 /etc/config/nut_monitor
+/etc/nut/upsmon.conf
 endef
 
 define Package/nut-upsmon/install
@@ -149,6 +167,7 @@ define Package/nut-upsmon/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/nut-monitor.init $(1)/etc/init.d/nut-monitor
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin/
+       $(INSTALL_BIN) ./files/nutshutdown $(1)/usr/sbin/nutshutdown
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/nut_monitor $(1)/etc/config/nut_monitor
        ln -sf /var/etc/nut/upsmon.conf $(1)/etc/nut/upsmon.conf
@@ -182,7 +201,7 @@ define Package/nut-upsc/description
 $(call Package/nut/description/Default)
 upsc is provided as a quick way to poll the status of a UPS server. It
 can be used inside shell scripts and other programs that need UPS data
-but don not want to include the full interface.
+but do not want to include the full interface.
 endef
 
 define Package/nut-upsc/install
@@ -308,12 +327,15 @@ define Package/nut-web-cgi/install
        $(INSTALL_CONF) ./files/add_nut_httpd_conf $(1)/etc/uci-defaults/add_nut_httpd_conf
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats.html.sample $(1)/etc/nut/upsstats.html
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsstats-single.html.sample $(1)/etc/nut/upsstats-single.html
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.disable
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsset.conf.sample $(1)/etc/nut/upsset.conf.enable
+       $(SED) 's/### \?//' $(1)/etc/nut/upsset.conf.enable
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/nut_cgi $(1)/etc/config/nut_cgi
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/nut-cgi.init $(1)/etc/init.d/nut-cgi
        ln -sf /var/etc/nut/hosts.conf $(1)/etc/nut/hosts.conf
+       ln -sf /var/etc/nut/upsset.conf $(1)/etc/nut/upsset.conf
 endef
 
 define Package/nut-avahi-service
@@ -342,7 +364,7 @@ define DriverPackage
         define Package/nut-driver-$(2)
                $(call Package/nut/Default)
                TITLE:=$(2) (NUT $(1) driver)
-               DEPENDS:=nut +nut-common
+               DEPENDS:=nut +nut-server
                $(if $(filter $(1),snmp),DEPENDS+= @NUT_DRIVER_SNMP)
                $(if $(filter $(1),usb),DEPENDS+= @NUT_DRIVER_USB)
                $(if $(filter $(1),serial),DEPENDS+= @NUT_DRIVER_SERIAL)
@@ -502,9 +524,11 @@ CONFIGURE_ARGS += \
        --without-avahi \
        --$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
        --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
+       --without-doc \
        --without-neon \
        --without-powerman \
        --without-wrap \
+       --with-hotplug-dir=/etc/hotplug \
        --with-cgi \
        --without-ipmi \
        --without-freeipmi \
diff --git a/net/nut/files/30-libhid-ups.head b/net/nut/files/30-libhid-ups.head
new file mode 100755 (executable)
index 0000000..efcbcf6
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+nut_driver_config() {
+       local cfg="$1"
+       local nomatch="$2"
+
+       config_get runas "$cfg" runas "nut"
+       config_get vendorid "$cfg" vendorid
+       config_get productid "$cfg" productid
+
+       [ "$ACTION" = "add" ] &&[ -n "$DEVNAME" ] && {
+               chmod 0660 /dev/"$DEVNAME"
+               chown ${runas:-root}:$(id -gn "${runas:-root}") /dev/"$DEVNAME"
+       }
+
+       if [ "$(printf "%04x" 0x"$pvendid")" = "$vendorid" ] && \
+               [ "$(printf "%04x" 0x"$pprodid")" = "$productid" ]; then
+                       [ "$ACTION" = "add" ] && {
+                               /etc/init.d/nut-server start "$cfg"
+                       }
+                       [ "$ACTION" = "remove" ] && {
+                               /etc/init.d/nut-server stop "$cfg"
+                       }
+                       found=1
+       elif [ "$nomatch" = "1" ]; then
+               [ "$ACTION" = "add" ] && {
+                       /etc/init.d/nut-server start "$cfg"
+               }
+               [ "$ACTION" = "remove" ] && {
+                       /etc/init.d/nut-server stop "$cfg"
+               }
+       fi
+}
+
+perform_libhid_action() {
+       local vendorid productid runas
+       local pvendid pprodid found
+
+       pvendid=${PRODUCT%/*}
+       pvendid=${pvendid%/*}
+       pprodid=${PRODUCT%/*}
+       pprodid=${pprodid##*/}
+
+       config_load nut_server
+       config_foreach nut_driver_config driver 0
+       [ "$found" != "1" ] && config_foreach nut_driver_config driver 1
+}
+
+[ -n "$PRODUCT" ] && case "$PRODUCT" in
diff --git a/net/nut/files/30-libhid-ups.tail b/net/nut/files/30-libhid-ups.tail
new file mode 100644 (file)
index 0000000..24c2a96
--- /dev/null
@@ -0,0 +1,5 @@
+"")
+       [ -d /var/run/nut ] && [ ! -f /var/run/nut/disable-hotplug ] && \
+               /etc/init.d/nut-server enabled &&  perform_libhid_action
+       ;;
+esac
index d63d98ba95d4618ae036337d95579054dc61bc83..ceb7cce2266cdda9ee89829492d1c771216acf9b 100755 (executable)
@@ -5,9 +5,24 @@
 # See /LICENSE for more information.
 #
 START=51
+USE_PROCD=1
 
 DEFAULT=/etc/default/nut
 UPSCGI_C=/var/etc/nut/hosts.conf
+UPSCGI_S=/var/etc/nut/upsset.conf
+
+nut_upscgi_upsset() {
+       local cfg="$1"
+       local enable
+
+       config_get_bool enable "$cfg" enable 0
+
+       [ $enable -eq 1 ] && {
+               ln -sf /etc/nut/upsset.conf.enable "$UPSCGI_S"
+       } || {
+               ln -sf /etc/nut/upsset.conf.disable "$UPSCGI_S"
+       }
+}
 
 nut_upscgi_add() {
        local cfg="$1"
@@ -25,20 +40,32 @@ nut_upscgi_add() {
            system="$system:$port";
        fi
        config_get displayname "$cfg" displayname
-       echo "MONITOR $system \"$displayname\"" >> $UPSCGI_C
+       echo "MONITOR $system \"$displayname\"" >> "$UPSCGI_C"
 }
 
-start() {
-       rm -f $UPSCGI_C
+service_reload() {
+       mkdir -m 0755 -p "$(dirname "$UPSCGI_C")"
+       rm -f "$UPSCGI_C"
+       rm -f "$UPSCGI_S"
 
        config_load nut_cgi
 
        config_foreach nut_upscgi_add host
+       config_foreach nut_upscgi_upsset upsset
 
        chmod 640 /var/etc/nut/hosts.conf
 }
 
-stop() {
-       rm -f $UPSCGI_C
+start_service() {
+       service_reload
+}
+
+stop_service() {
+       rm -f "$UPSCGI_C"
+       rm -f "$UPSCGI_S"
+       ln -sf /etc/nut/upsset.conf.disable "$UPSCGI_S"
 }
 
+service_triggers() {
+       procd_add_reload_trigger "nut_cgi"
+}
index af814078106534f4848d8be2fae67175f397aebd..513d703058b27ebe64f8a5c59213fd8726843f57 100755 (executable)
@@ -6,56 +6,57 @@ UPSMON_C=/var/etc/nut/upsmon.conf
 
 nut_upsmon_conf() {
        local cfg="$1"
+       local RUNAS val optval
 
-       echo "# Config file automatically generated from UCI config" > $UPSMON_C
+       echo "# Config file automatically generated from UCI config" > "$UPSMON_C"
 
-       config_get runas "$cfg" runas "nut"
-       [ -n "$runas" ] && echo "RUN_AS_USER $runas" >> $UPSMON_C
+       config_get RUNAS "$cfg" runas "nutmon"
+       [ -n "$RUNAS" ] && echo "RUN_AS_USER $RUNAS" >> "$UPSMON_C"
+       runas=$RUNAS
 
        config_get val "$cfg" minsupplies 1
-       echo "MINSUPPLIES $val" >> $UPSMON_C
+       echo "MINSUPPLIES $val" >> "$UPSMON_C"
 
-       config_get val "$cfg" shutdowncmd "/sbin/halt"
-       echo "SHUTDOWNCMD \"$val\"" >> $UPSMON_C
+       config_get val "$cfg" shutdowncmd "/usr/sbin/nutshutdown"
+       echo "SHUTDOWNCMD \"$val\"" >> "$UPSMON_C"
 
        config_get val "$cfg" notifycmd
-       [ -n "$val" ] && echo "NOTIFYCMD \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYCMD \"$val\"" >> "$UPSMON_C"
 
        config_get val "$cfg" pollfreq 5
-       echo "POLLFREQ $val" >> $UPSMON_C
+       echo "POLLFREQ $val" >> "$UPSMON_C"
 
        config_get val "$cfg" pollfreqalert 5
-       echo "POLLFREQALERT $val" >> $UPSMON_C
+       echo "POLLFREQALERT $val" >> "$UPSMON_C"
 
        config_get val "$cfg" hostsync 15
-       echo "HOSTSYNC $val" >> $UPSMON_C
+       echo "HOSTSYNC $val" >> "$UPSMON_C"
 
        config_get val "$cfg" deadtime 15
-       echo "DEADTIME $val" >> $UPSMON_C
+       echo "DEADTIME $val" >> "$UPSMON_C"
 
-       config_get val "$cfg" powerdownflag /var/run/killpower
-       echo "POWERDOWNFLAG $val" >> $UPSMON_C
+       echo "POWERDOWNFLAG /var/run/killpower" >> "$UPSMON_C"
 
        config_get val "$cfg" onlinemsg
-       [ -n "$val" ] && echo "NOTIFYMSG ONLINE \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG ONLINE \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" onbattmsg
-       [ -n "$val" ] && echo "NOTIFYMSG ONBATT \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG ONBATT \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" lowbattmsg
-       [ -n "$val" ] && echo "NOTIFYMSG LOWBATT \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG LOWBATT \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" fsdmsg
-       [ -n "$val" ] && echo "NOTIFYMSG FSD \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG FSD \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" commokmsg
-       [ -n "$val" ] && echo "NOTIFYMSG COMMOK \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG COMMOK \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" commbadmsg
-       [ -n "$val" ] && echo "NOTIFYMSG COMMBAD \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG COMMBAD \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" shutdownmsg
-       [ -n "$val" ] && echo "NOTIFYMSG SHUTDOWN \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG SHUTDOWN \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" replbattmsg
-       [ -n "$val" ] && echo "NOTIFYMSG REPLBATT \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG REPLBATT \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" nocommmsg
-       [ -n "$val" ] && echo "NOTIFYMSG NOCOMM \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG NOCOMM \"$val\"" >> "$UPSMON_C"
        config_get val "$cfg" noparentmsg
-       [ -n "$val" ] && echo "NOTIFYMSG NOPARENT \"$val\"" >> $UPSMON_C
+       [ -n "$val" ] && echo "NOTIFYMSG NOPARENT \"$val\"" >> "$UPSMON_C"
 
        notifylist() {
                local value="$1"
@@ -85,34 +86,34 @@ nut_upsmon_conf() {
        val=""
        config_list_foreach "$cfg" defaultnotify notifylist
        default="$optval"
-       echo "NOTIFYFLAG ONLINE $(setnotify "$cfg" onlinenotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG ONBATT $(setnotify "$cfg" onbattnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG LOWBATT $(setnotify "$cfg" lowbatnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG FSD $(setnotify "$cfg" fsdnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG COMMOK $(setnotify "$cfg" commoknotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG COMMBAD $(setnotify "$cfg" commbadnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG SHUTDOWN $(setnotify "$cfg" shutdownnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG REPLBATT $(setnotify "$cfg" repolbattnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG NOCOMM $(setnotify "$cfg" nocommnotify)" >> $UPSMON_C
-       echo "NOTIFYFLAG NOPARENT $(setnotify "$cfg" noparentnotify)" >> $UPSMON_C
+       echo "NOTIFYFLAG ONLINE $(setnotify "$cfg" onlinenotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG ONBATT $(setnotify "$cfg" onbattnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG LOWBATT $(setnotify "$cfg" lowbatnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG FSD $(setnotify "$cfg" fsdnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG COMMOK $(setnotify "$cfg" commoknotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG COMMBAD $(setnotify "$cfg" commbadnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG SHUTDOWN $(setnotify "$cfg" shutdownnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG REPLBATT $(setnotify "$cfg" repolbattnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG NOCOMM $(setnotify "$cfg" nocommnotify)" >> "$UPSMON_C"
+       echo "NOTIFYFLAG NOPARENT $(setnotify "$cfg" noparentnotify)" >> "$UPSMON_C"
 
        config_get val "$cfg" rbwarntime 43200
-       echo "RBWARNTIME $val" >> $UPSMON_C
+       echo "RBWARNTIME $val" >> "$UPSMON_C"
 
        config_get val "$cfg" nocommwarntime 300
-       echo "NOCOMMWARNTIME $val" >> $UPSMON_C
+       echo "NOCOMMWARNTIME $val" >> "$UPSMON_C"
 
        config_get val "$cfg" finaldelay 5
-       echo "FINALDELAY $val" >> $UPSMON_C
+       echo "FINALDELAY $val" >> "$UPSMON_C"
 
        config_get val "$cfg" certpath
-       if [ -n "$val" ]; then echo "CERTPATH $val" >> $UPSMON_C; fi
+       if [ -n "$val" ]; then echo "CERTPATH $val" >> "$UPSMON_C"; fi
 
        config_get_bool val "$cfg" certverify 0
-       if [ -n "$val" ]; then echo "CERTVERIFY $val" >> $UPSMON_C; fi
+       if [ -n "$val" ]; then echo "CERTVERIFY $val" >> "$UPSMON_C"; fi
 
        config_get_bool val "$cfg" forcessl 0
-       if [ -n "$val" ]; then echo "FORCESSL $val" >> $UPSMON_C; fi
+       if [ -n "$val" ]; then echo "FORCESSL $val" >> "$UPSMON_C"; fi
 }
 
 nut_upsmon_add() {
@@ -126,12 +127,6 @@ nut_upsmon_add() {
        local password
        local system
 
-       # if UPSMON_C is a symlink we're only doing generated config
-       [ -L $UPSMON_C ] && {
-               rm -f $UPSMON_C
-               nut_upsmon_conf ""
-       }
-
        config_get upsname "$cfg" upsname
        config_get hostname "$cfg" hostname localhost
        config_get port "$cfg" port
@@ -142,40 +137,49 @@ nut_upsmon_add() {
        if [ -n "$port" ]; then
            system="$system:$port";
        fi
-       echo "MONITOR $system $powervalue $username $password $type" >> $UPSMON_C
+       echo "MONITOR $system $powervalue $username $password $type" >> "$UPSMON_C"
 }
 
-start_service() {
-       mkdir -p "$(dirname "$UPSMON_C")"
-       chmod 750 "$(dirname "$UPSMON_C")"
+build_config() {
+       local runas
+       mkdir -m 0750 -p "$(dirname "$UPSMON_C")"
 
        config_load nut_monitor
-
        config_foreach nut_upsmon_conf upsmon
        config_foreach nut_upsmon_add master master
        config_foreach nut_upsmon_add slave slave
 
-       [ -z "$(cat /var/etc/nut/nut.conf)" ] && echo "MODE=netclient" >>/var/etc/nut/nut.conf
-
-       chmod 640 $UPSMON_C
-       chmod 640 /var/etc/nut/nut.conf
-
-       chown ${runas:-root}:$(id -gn ${runas:-root}) /var/etc/nut
-       chown ${runas:-root}:$(id -gn ${runas:-root}) /var/etc/nut/nut.conf
-       chown ${runas:-root}:$(id -gn ${runas:-root}) $UPSMON_C
-
-       [ -d /var/run/nut ] || {
-               mkdir -m 0750 -p /var/run/nut
-               chown ${runas:-root}:$(id -gn ${runas:-root}) /var/run/nut
+       [ -z "$(cat /var/etc/nut/nut.conf)" ] && {
+               echo "MODE=netclient" >>/var/etc/nut/nut.conf
+               chmod 640 /var/etc/nut/nut.conf
+               chgrp $(id -gn ${runas:-root}) /var/etc/nut/nut.conf
        }
 
-       exec $DEBUG /usr/sbin/upsmon $UPSMON_OPTIONS
+       chmod 640 "$UPSMON_C"
+       chgrp $(id -gn ${runas:-root}) "$UPSMON_C"
 }
 
-stop_service() {
-       exec /usr/sbin/upsmon -c stop
+start_service() {
+       build_config
+       procd_open_instance
+       procd_set_param respawn
+       procd_set_param stderr 0
+       procd_set_param stdout 1
+       procd_set_param command /usr/sbin/upsmon -D
+       procd_close_instance
 }
 
 reload_service() {
-       exec /usr/sbin/upsmon -c reload
+       if pgrep upsmon >/dev/null 2>/dev/null; then
+               build_config
+               upsmon -c reload
+       else
+               stop
+               sleep 1
+               start
+       fi
+}
+
+service_triggers() {
+       procd_add_reload_trigger nut_monitor
 }
index e064dd721358bb31681fca75f8ccb4146e31e9a6..73bf30ea183410fad316cb754dab013ba4546d03 100755 (executable)
@@ -6,47 +6,70 @@
 #
 START=50
 
-RUN_D=/var/run
-PID_F=$RUN_D/upsd.pid
-UPS_C=/var/etc/nut/ups.conf
 USERS_C=/var/etc/nut/upsd.users
 UPSD_C=/var/etc/nut/upsd.conf
+UPS_C=/var/etc/nut/ups.conf
 
 USE_PROCD=1
 
-listen_address() {
-    local cfg="$1"
+get_write_driver_config() {
+       local cfg="$1"
+       local var="$2"
+       local def="$3"
+       local flag="$4"
+       local val
 
-    config_get address "$cfg" address "::1"
-    config_get port "$cfg" port
-    echo "LISTEN $address $port" >>$UPSD_C
+       [ -z "$flag" ] && {
+               config_get val "$cfg" "$var" "$def"
+               [ -n "$val" ] && [ "$val" != "0" ] && echo "$var = $val" >>"$UPS_C"
+       }
+
+       [ -n "$flag" ] && {
+               config_get_bool val "$cfg" "$var" "$def"
+               [ "$val" = 1 ] && echo "$var" >>"$UPS_C"
+       }
 }
 
 upsd_statepath() {
+       local cfg="$1"
+       local statepath
+
+       config_get statepath "$cfg" statepath "/var/run/nut"
+       STATEPATH="$statepath"
+}
+
+listen_address() {
     local cfg="$1"
-    config_get statepath "$cfg" statepath
+
+    config_get address "$cfg" address "::1"
+    config_get port "$cfg" port
+    echo "LISTEN $address $port" >>"$UPSD_C"
 }
 
 upsd_config() {
     local cfg="$1"
-    local maxage maxconn certfile
+    local maxage maxconn certfile runas statepath
 
     # Note runas support requires you make sure USB device file is readable by
     # the runas user
-    config_get runas "$cfg" runas
+    config_get runas "$cfg" runas "nut"
+    RUNAS="$runas"
+
+    config_get statepath "$cfg" statepath "/var/run/nut"
+    STATEPATH="$statepath"
 
     config_get maxage "$cfg" maxage
-    [ -n "$maxage" ] && echo "MAXAGE $maxage" >>$UPSD_C
+    [ -n "$maxage" ] && echo "MAXAGE $maxage" >>"$UPSD_C"
 
     config_get statepath "$cfg" statepath
-    [ -n "$statepath" ] && echo "STATEPATH $statepath" >>$UPSD_C
+    [ -n "$statepath" ] && echo "STATEPATH $statepath" >>"$UPSD_C"
 
     config_get maxconn "$cfg" maxconn
-    [ -n "$maxconn" ] && echo "MAXCONN $maxconn" >>$UPSD_C
+    [ -n "$maxconn" ] && echo "MAXCONN $maxconn" >>"$UPSD_C"
 
     #NOTE: certs only apply to SSL-enabled version
     config_get certfile "$cfg" certfile
-    [ -n "$certfile" ] && echo "CERTFILE $certfile" >>$UPSD_C
+    [ -n "$certfile" ] && echo "CERTFILE $certfile" >>"$UPSD_C"
 }
 
 nut_user_add() {
@@ -55,104 +78,180 @@ nut_user_add() {
        local val
 
        config_get val "$cfg" username "$1"
-       echo "[$val]" >> $USERS_C
+       echo "[$val]" >> "$USERS_C"
 
        config_get val "$cfg" password
-       echo "  password = $val" >> $USERS_C
+       echo "  password = $val" >> "$USERS_C"
 
        config_get val "$cfg" actions
        for a in $val; do
-           echo "  actions = $a" >> $USERS_C
+           echo "  actions = $a" >> "$USERS_C"
        done
 
        instcmd() {
                local val="$1"
-               echo "  instcmds = $val" >> $USERS_C
+               echo "  instcmds = $val" >> "$USERS_C"
        }
 
        config_list_foreach "$cfg" instcmd instcmd
 
        config_get val "$cfg" upsmon
        if [ -n "$val" ]; then
-           echo "  upsmon $val" >> $USERS_C
+           echo "  upsmon $val" >> "$USERS_C"
        fi
 }
 
-start_service() {
-       local runas statepath
-
-        mkdir -p /var/etc/nut
-       chmod -R 750 /var/etc/nut
-
-       rm -f $UPSD_C
-       rm -f $USERS_C
-       rm -f $UPSD_C
+build_server_config() {
+        mkdir -m 0755 -p "$(dirname "$UPSD_C")"
+       rm -f "$USERS_C"
+       rm -f "$UPSD_C"
        rm -f /var/etc/nut/nut.conf
 
-       echo "# Config file automatically generated from UCI config" > $UPS_C
-       echo "# Config file automatically generated from UCI config" > $USERS_C
-       echo "# Config file automatically generated from UCI config" > $UPSD_C
-
-        local in_driver have_drivers
-       config_cb() {
-           if [ "$1" != "driver" ]; then
-               in_driver=
-           else
-               echo "[$2]" >> $UPS_C
-               in_driver=true
-               have_drivers=true
-           fi
-       }
-       option_cb() {
-           if [ "$in_driver" = "true" ]; then
-               echo " $1 = $2" >> $UPS_C
-           fi
-       }
-
-       config_load nut_server
+       echo "# Config file automatically generated from UCI config" > "$USERS_C"
+       echo "# Config file automatically generated from UCI config" > "$UPSD_C"
 
        config_foreach nut_user_add user
-       config_foreach upsd_config upsd
        config_foreach listen_address listen_address
-
+       config_foreach upsd_config upsd
        echo "MODE=netserver" >>/var/etc/nut/nut.conf
 
-       chmod 0640 $USERS_C
-       chmod 0640 $UPS_C
-       chmod 0640 $UPSD_C
+       chmod 0640 "$USERS_C"
+       chmod 0640 "$UPSD_C"
        chmod 0640 /var/etc/nut/nut.conf
-       [ -d "${statepath:-/var/run/nut}" ] || {
-               mkdir -m 0750 -p "${statepath:-/var/run/nut}"
-               chown $runas:$(id -gn $runas) "${statepath:-/var/run/nut}"
+
+       [ -d "${STATEPATH}" ] || {
+               mkdir -m 0750 -p "${STATEPATH}"
        }
 
-       if [ -n "$runas" ]; then
-               chown -R $runas:$(id -gn $runas) /var/etc/nut
+       if [ -n "$RUNAS" ]; then
+               chown $RUNAS:$(id -gn $RUNAS) "${STATEPATH}"
+               chgrp $(id -gn $RUNAS) "$USERS_C"
+               chgrp $(id -gn $RUNAS) "$UPSD_C"
        fi
+}
 
-       if [ "$have_drivers" = "true" ]; then
-           $DEBUG /usr/sbin/upsd ${runas:+-u $runas} $OPTIONS
-           $DEBUG /usr/sbin/upsdrvctl ${runas:+-u $runas} start
-       fi
+build_driver_config() {
+       local cfg="$1"
+       local runas
+
+       echo "[$cfg]" >>"$UPS_C"
+
+       config_get runas "$cfg" runas "nut"
+       RUNAS="$runas"
+
+       get_write_driver_config "$cfg" driver "usbhid-ups"
+       get_write_driver_config "$cfg" port "auto"
+       get_write_driver_config "$cfg" mfr
+       get_write_driver_config "$cfg" model
+       get_write_driver_config "$cfg" serial
+       get_write_driver_config "$cfg" sdtime
+       get_write_driver_config "$cfg" offdelay 20
+       get_write_driver_config "$cfg" ondelay 30
+       get_write_driver_config "$cfg" pollfreq 30
+       get_write_driver_config "$cfg" vendor
+       get_write_driver_config "$cfg" product
+       get_write_driver_config "$cfg" bus
+       get_write_driver_config "$cfg" interruptonly 0 1
+       get_write_driver_config "$cfg" interruptsize 0
+       get_write_driver_config "$cfg" maxreport
+       get_write_driver_config "$cfg" vendorid
+       get_write_driver_config "$cfg" productid
+       get_write_driver_config "$cfg" community
+       get_write_driver_config "$cfg" snmp_version
+       get_write_driver_config "$cfg" snmp_retries 0
+       get_write_driver_config "$cfg" snmp_timeout 0
+       get_write_driver_config "$cfg" notransferoids 0 1
+       get_write_driver_config "$cfg" other
+       echo "" >>$UPS_C
 }
 
+build_config() {
+        mkdir -m 0755 -p "$(dirname "$UPS_C")"
+       rm -f "$UPS_C"
+       echo "# Config file automatically generated from UCI config" > "$UPS_C"
+       chmod 0640 "$UPS_C"
+
+       config_load nut_server
+       config_foreach build_driver_config driver
+       [ -n "$RUNAS" ] && chgrp $(id -gn $RUNAS) "$UPS_C"
 
-nut_driver_stop() {
+       build_server_config
+}
+
+start_driver_instance() {
        local cfg="$1"
+       local requested="$2"
+       local RUNAS=nut
        local driver
 
-       config_get driver "$cfg" driver
+       # If wanting a specific instance, only start it
+       [ "$requested" != "$cfg" ] && [ x"$requested" != x"" ] && return 0
+
+       mkdir -m 0755 -p "$(dirname "$UPS_C")"
+
+       [ ! -s "$UPS_C" ] && build_config
+
 
-       [ -r ${statepath:-/var/run/nut}/$driver-$cfg ] && /usr/sbin/upsdrvctl stop $cfg
+       # Avoid hotplug inadvertenly restarting driver during
+       # forced shutdown
+       [ -f /var/run/killpower ] && return 0
+       [ -d /var/run/nut ] && [ -f /var/run/nut/disable-hotplug ] && return 0
+
+
+       if [ -n "$RUNAS" ]; then
+               chown $RUNAS:$(id -gn $RUNAS) "${STATEPATH}"
+               chown $RUNAS:$(id -gn $RUNAS) "$(dirname "$UPS_C")"
+       fi
+
+       config_get driver "$cfg" driver "usbhid-ups"
+       procd_open_instance "$cfg"
+       procd_set_param respawn
+       procd_set_param stderr 0
+       procd_set_param stdout 1
+       procd_set_param command /lib/nut/${driver} -D -a "$cfg" ${RUNAS:+-u $RUNAS}
+       procd_close_instance
+}
+
+start_server_instance() {
+       local RUNAS STATEPATH
+       build_config
+
+       procd_open_instance "upsd"
+       procd_set_param respawn
+       procd_set_param stderr 0
+       procd_set_param stdout 1
+       procd_set_param command /usr/sbin/upsd -D ${RUNAS:+-u $RUNAS}
+       procd_close_instance
 }
 
-stop_service() {
-       [ -r $PID_F ] && /usr/sbin/upsd -c stop
-       config_load ups
+start_service() {
+       local STATEPATH=/var/run/nut
+
+       # Avoid hotplug inadvertenly restarting driver during
+       # forced shutdown
+       [ -f /var/run/killpower ] && return 0
+       [ -d /var/run/nut ] && [ -f /var/run/nut/disable-hotplug ] && return 0
+
+       config_load nut_server
        config_foreach upsd_statepath upsd
-       config_foreach nut_driver_stop driver
+
+       [ -d "${STATEPATH}" ] || {
+               mkdir -m 0750 -p "${STATEPATH}"
+       }
+
+       build_config
+       config_foreach start_driver_instance driver "$@"
+
+       [ "$1" != "upsd" ] && [ x"$1" != x"" ] && return 0
+       start_server_instance "upsd"
 }
 
 reload_service() {
-       upsd -c reload
+       stop
+       sleep 2
+       start
+}
+
+service_triggers() {
+       procd_add_reload_trigger "nut_server"
 }
index 9f0bed6fc10f42370651b2c450c8ce6b25bad7e0..dca5de07cc645d5ceedd17bbc26f24c4a70a3bbc 100644 (file)
@@ -4,3 +4,5 @@
 #      option port # optional port number
 #      option displayname "Display Name"
 
+config upsset
+       option enable 0
index 0b71e95cf05b46da7be6bac3046bdac46b696bf4..59e0f360daeeb02b342feaecee12293d7f268522 100644 (file)
@@ -1,14 +1,13 @@
 #config upsmon 'upsmon'
-#      option runas run-as-user
+#      option runas nutmon
 #      option minsupplies 1
-#      option shutdowncmd /sbin/halt
+#      option shutdowncmd '/usr/sbin/nutshutdown'
 #      option notifycmd /path/to/cmd
 #      list defaultnotify SYSLOG
 #      option pollfreq 5
 #      option pollfreqalert 5
 #      option hostsync 15
 #      option deadtime 15
-#      option powerdownflags /var/run/killpower
 #      option onlinemsg "online message"
 #      option onbattmsg "on battery message"
 #      option lowbattmsg "low battery message"
@@ -51,4 +50,3 @@
 #      option powervalue 1
 #      option username upsuser
 #      option password upspassword
-
index bebd169db61756adaaceb6889005c0abdfdb4521..464d56303be09e87fd9484b79c7012a203f684db 100644 (file)
@@ -19,5 +19,6 @@
 #      option maxage 15
 #      option statepath /var/run/nut
 #      option maxconn 1024
+#      option runas nut
 # NB: certificates only apply to SSL-enabled version
 #       option certfile /usr/local/etc/upsd.pem
diff --git a/net/nut/files/nutshutdown b/net/nut/files/nutshutdown
new file mode 100755 (executable)
index 0000000..e4fd962
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+. /lib/functions.sh
+
+mount -o remount,ro /overlay /overlay
+mount -o remount,ro / /
+
+stop_instance() {
+       /etc/init.d/nut-server stop "$1"
+}
+
+shutdown_instance() {
+       local cfg="$1"
+       config_get driver "$cfg" driver "usbhid-ups"
+       /lib/nut/${driver} -a "$cfg" -k
+}
+
+[ -f /var/run/killpower ] && {
+       [ -f /etc/config/nut_server ] && {
+               config_load nut_server
+
+               # Can't FSD unless drivers are stopped
+               config_foreach stop_instance driver
+               # Driver will  wait 'offdelay' before shutting down
+               config_foreach shutdown_instance driver
+               # So this can happen
+               poweroff
+               # And just in case
+               sleep 120
+               # Uh-oh failed to poweroff UPS
+               reboot -f
+       } || {
+               poweroff
+       }
+} || {
+       poweroff
+}
index 6d1c437a4e730f7f506c707d495a56375dc353ce..9ed24eec2bb2219195895ce0cdf948417f9bf23f 100644 (file)
@@ -9,9 +9,14 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
+# Checklist on version bump
+#
+#  - Check acinclude.m4 for range of supported kernel versions: "but version newer than .* is not supported"
+#  - Check and update kmod dependencies when necessary (runtime module load check in the least)
+#
 PKG_NAME:=openvswitch
 PKG_VERSION:=2.10.0
-PKG_RELEASE:=1
+PKG_RELEASE:=4
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
 PKG_HASH:=64f7cdcfffc73b2e09980d04ee22731eadd6453698b92d7397c9e45c7c174050
@@ -32,67 +37,101 @@ include ../../lang/python/python-host.mk
 include ../../lang/python/python-package.mk
 
 
-CONFIGURE_ARGS+= \
-       --enable-ndebug \
-       --enable-shared \
-       --disable-libcapng \
+ovs_kmod_packages:=
+ovs_kmod_intree_kernel_patchver_min:=3.10
+ovs_kmod_intree_kernel_patchver_max:=4.15
+ovs_kmod_intree_not_supported:=$(strip $(call kernel_patchver_lt,$(ovs_kmod_intree_kernel_patchver_min))$(call kernel_patchver_gt,$(ovs_kmod_intree_kernel_patchver_max)))
+ovs_kmod_intree_dir:=$(PKG_BUILD_DIR)/datapath/linux
+ovs_kmod_upstream_dir:=$(LINUX_DIR)/net/openvswitch
+ovs_kmod_package_name=$(if $(filter openvswitch,$(1)),openvswitch,$(1))
+ovs_kmod_is_intree=$(filter %-intree,$(1))
+ovs_kmod_upstream_name=kmod-$(call ovs_kmod_package_name,$(patsubst %-intree,%,$(1)))
+ovs_kmod_package_provides=$(call ovs_kmod_upstream_name,$(1))
+define OvsKmodPackageTemplate
+  define KernelPackage/$(call ovs_kmod_package_name,$(1))
+     SECTION:=kernel
+     CATEGORY:=Kernel modules
+     SUBMENU:=Network Support
+     TITLE:=$(ovs_kmod_$(1)_title)
+     DEPENDS:=$(ovs_kmod_$(1)_depends) $(if $(call ovs_kmod_is_intree,$(1)),@DEVEL $(if $(ovs_kmod_intree_not_supported),@BROKEN))
+     PROVIDES:=$(call ovs_kmod_package_provides,$(1))
+     KCONFIG:=$(ovs_kmod_$(1)_kconfig)
+     FILES:=$(ovs_kmod_$(1)_files)
+     AUTOLOAD:=$(call AutoProbe,$(foreach m,$(ovs_kmod_$(1)_files),$(patsubst %.ko,%,$(basename $(m)))))
+  endef
 
-CONFIGURE_VARS += \
-       ovs_cv_flake8=no \
-       ovs_cv_python3=no \
-       ovs_cv_sphinx=no \
-       ovs_cv_python=$(PYTHON) \
-       ovs_cv_python_host=$(HOST_PYTHON_BIN) \
+  ovs_kmod_packages+=$(call ovs_kmod_package_name,$(1))
+endef
 
-TARGET_CFLAGS += -flto -std=gnu99
-MAKE_VARS += PYTHONPATH="$(HOST_PYTHONPATH)"
+ovs_kmod_openvswitch_title:=Open vSwitch kernel datapath (upstream)
+ovs_kmod_openvswitch_kconfig:=CONFIG_OPENVSWITCH
+ovs_kmod_openvswitch_depends:=\
+         +kmod-lib-crc32c +kmod-mpls \
+         +kmod-nf-nat +IPV6:kmod-nf-nat6 \
+         +kmod-nf-conntrack +IPV6:kmod-nf-conntrack6
+ovs_kmod_openvswitch_files:=$(ovs_kmod_upstream_dir)/openvswitch.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch))
+
+ovs_kmod_openvswitch-gre_title:=Open vSwitch GRE tunneling support (upstream)
+ovs_kmod_openvswitch-gre_kconfig:= CONFIG_OPENVSWITCH_GRE
+ovs_kmod_openvswitch-gre_depends:= +kmod-openvswitch +kmod-gre
+ovs_kmod_openvswitch-gre_files:= $(ovs_kmod_upstream_dir)/vport-gre.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-gre))
+
+ovs_kmod_openvswitch-vxlan_title:=Open vSwitch VXLAN tunneling support (upstream)
+ovs_kmod_openvswitch-vxlan_kconfig:= CONFIG_OPENVSWITCH_VXLAN
+ovs_kmod_openvswitch-vxlan_depends:= +kmod-openvswitch +kmod-vxlan
+ovs_kmod_openvswitch-vxlan_files:= $(ovs_kmod_upstream_dir)/vport-vxlan.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-vxlan))
+
+ovs_kmod_openvswitch-geneve_title:=Open vSwitch Geneve tunneling support (upstream)
+ovs_kmod_openvswitch-geneve_kconfig:= CONFIG_OPENVSWITCH_GENEVE
+ovs_kmod_openvswitch-geneve_depends:= +kmod-openvswitch +kmod-geneve
+ovs_kmod_openvswitch-geneve_files:= $(ovs_kmod_upstream_dir)/vport-geneve.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-geneve))
+
+# NOTE depends
+#
+#  - kmod-gre: with linux-4.14, ovs-2.10, when ovs decides to not
+#    USE_UPSTREAM_TUNNEL, it requires kmod-gre to be enabled so that
+#    CONFIG_NET_IPGRE_DEMUX is enabled and ovs will have rpl_gre_init()
+#    compiled in.
+#
+#  - kmod-gre6: with linux-4.14, ovs-2.10, when ovs decides to not
+#    USE_UPSTREAM_TUNNEL, it requires xfrm6_tunnel_register() from
+#    net/ipv6/tunnel6.ko, which will be pulled in by kmod-ip6-tunnel, which
+#    will be pulled in by kmod-gre6.  NOTE that tunnel6.ko itself cannot be
+#    enabled and selected on its own
+#
+ovs_kmod_openvswitch-intree_title:=Open vSwitch kernel datapath (in tree)
+ovs_kmod_openvswitch-intree_depends:=$(ovs_kmod_openvswitch_depends) +kmod-gre +IPV6:kmod-gre6
+ovs_kmod_openvswitch-intree_files:= $(ovs_kmod_intree_dir)/openvswitch.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-intree))
 
+ovs_kmod_openvswitch-gre-intree_title:=Open vSwitch GRE tunneling support (in tree)
+ovs_kmod_openvswitch-gre-intree_depends:= +kmod-openvswitch-intree +kmod-gre
+ovs_kmod_openvswitch-gre-intree_files:= $(ovs_kmod_intree_dir)/vport-gre.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-gre-intree))
 
-define KernelPackage/openvswitch
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Support
-  TITLE:=Open vSwitch kernel datapath
-  KCONFIG:=CONFIG_OPENVSWITCH
-  DEPENDS:= \
-       +kmod-lib-crc32c +kmod-mpls \
-       +kmod-nf-nat +IPV6:kmod-nf-nat6
-  FILES:= $(LINUX_DIR)/net/openvswitch/openvswitch.ko
-  AUTOLOAD:=$(call AutoProbe,openvswitch)
-endef
+ovs_kmod_openvswitch-vxlan-intree_title:=Open vSwitch VXLAN tunneling support (in tree)
+ovs_kmod_openvswitch-vxlan-intree_depends:= +kmod-openvswitch-intree +kmod-vxlan
+ovs_kmod_openvswitch-vxlan-intree_files:= $(ovs_kmod_intree_dir)/vport-vxlan.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-vxlan-intree))
 
-define KernelPackage/openvswitch-gre
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Support
-  TITLE:=Open vSwitch GRE tunneling support
-  KCONFIG:= CONFIG_OPENVSWITCH_GRE
-  DEPENDS:= +kmod-openvswitch +kmod-gre
-  FILES:= $(LINUX_DIR)/net/openvswitch/vport-gre.ko
-  AUTOLOAD:=$(call AutoProbe,vport-gre)
-endef
+ovs_kmod_openvswitch-geneve-intree_title:=Open vSwitch Geneve tunneling support (in tree)
+ovs_kmod_openvswitch-geneve-intree_depends:= +kmod-openvswitch-intree +kmod-geneve
+ovs_kmod_openvswitch-geneve-intree_files:= $(ovs_kmod_intree_dir)/vport-geneve.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-geneve-intree))
 
-define KernelPackage/openvswitch-vxlan
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Support
-  TITLE:=Open vSwitch VXLAN tunneling support
-  KCONFIG:= CONFIG_OPENVSWITCH_VXLAN
-  DEPENDS:= +kmod-openvswitch +kmod-vxlan
-  FILES:= $(LINUX_DIR)/net/openvswitch/vport-vxlan.ko
-  AUTOLOAD:=$(call AutoProbe,vport-vxlan)
-endef
+ovs_kmod_openvswitch-stt-intree_title:=Open vSwitch STT tunneling support (in tree)
+ovs_kmod_openvswitch-stt-intree_depends:= +kmod-openvswitch-intree
+ovs_kmod_openvswitch-stt-intree_files:= $(ovs_kmod_intree_dir)/vport-stt.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-stt-intree))
 
-define KernelPackage/openvswitch-geneve
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Support
-  TITLE:=Open vSwitch Geneve tunneling support
-  KCONFIG:= CONFIG_OPENVSWITCH_GENEVE
-  DEPENDS:= +kmod-openvswitch +kmod-geneve
-  FILES:= $(LINUX_DIR)/net/openvswitch/vport-geneve.ko
-  AUTOLOAD:=$(call AutoProbe,vport-geneve)
-endef
+ovs_kmod_openvswitch-lisp-intree_title:=Open vSwitch LISP tunneling support (in tree)
+ovs_kmod_openvswitch-lisp-intree_depends:= +kmod-openvswitch-intree
+ovs_kmod_openvswitch-lisp-intree_files:= $(ovs_kmod_intree_dir)/vport-lisp.ko
+$(eval $(call OvsKmodPackageTemplate,openvswitch-lisp-intree))
 
 
 ovs_packages:=
@@ -105,7 +144,7 @@ define OvsPackageTemplate
      URL:=https://www.openvswitch.org
      TITLE:=$(ovs_$(1)_title)
      HIDDEN:=$(ovs_$(1)_hidden)
-     DEPENDS:=$(ovs_$(1)_depends)
+     DEPENDS:=$(ovs_$(1)_depends) +libunbound
   endef
 
   define Package/$(call ovs_package_name,$(1))/install
@@ -173,6 +212,7 @@ ovs_common_depends:=+librt +openvswitch-libopenvswitch +openvswitch-libofproto +
 ovs_common_files:= \
        usr/share/openvswitch/scripts/ovs-lib \
        usr/share/openvswitch/scripts/ovs-ctl \
+       usr/share/openvswitch/scripts/ovs-kmod-ctl \
        usr/share/openvswitch/scripts/ovs-save \
        $(foreach b,ovs-appctl ovs-dpctl ovs-ofctl ovs-vsctl ovsdb-client ovsdb-tool,usr/bin/$(b))
 define ovs_common_install
@@ -184,6 +224,7 @@ define ovs_common_install
        $$(INSTALL_DIR) $$(1)/usr/share/openvswitch/scripts
        $$(INSTALL_BIN) ./files/ovs-ctl-wrapper $$(1)/usr/share/openvswitch/scripts/
        $$(LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$(1)/usr/bin/ovs-ctl
+       $$(LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$(1)/usr/bin/ovs-kmod-ctl
 endef
 define Package/openvswitch-common/conffiles
 /etc/openvswitch
@@ -242,11 +283,32 @@ endef
 $(eval $(call OvsPackageTemplate,python))
 
 
+CONFIGURE_ARGS+= \
+       --enable-ndebug \
+       --enable-shared \
+       --disable-libcapng \
+
+CONFIGURE_VARS += \
+       ovs_cv_flake8=no \
+       ovs_cv_python3=no \
+       ovs_cv_sphinx=no \
+       ovs_cv_python=$(PYTHON) \
+       ovs_cv_python_host=$(HOST_PYTHON_BIN) \
+       KARCH=$(LINUX_KARCH) \
+
+ovs_intree_kmod_configs:=CONFIG_PACKAGE_kmod-openvswitch-intree
+ovs_intree_kmod_enabled:=$(strip $(foreach c,$(ovs_intree_kmod_configs),$(c)))
+PKG_CONFIG_DEPENDS+=$(ovs_intree_kmod_configs)
+ifneq ($(ovs_intree_kmod_enabled),)
+  CONFIGURE_ARGS += --with-linux=$(LINUX_DIR)
+endif
+
+TARGET_CFLAGS += -flto -std=gnu99
+MAKE_VARS += PYTHONPATH="$(HOST_PYTHONPATH)"
+
+$(foreach p,$(ovs_kmod_packages),\
+  $(eval $(call KernelPackage,$(p)))\
+)
 $(foreach p,$(ovs_packages),\
   $(eval $(call BuildPackage,$(p)))\
 )
-
-$(eval $(call KernelPackage,openvswitch))
-$(eval $(call KernelPackage,openvswitch-gre))
-$(eval $(call KernelPackage,openvswitch-vxlan))
-$(eval $(call KernelPackage,openvswitch-geneve))
index f3b754e751b64b89009e6d0eb4a9ad9744e983dc..541056a498780bcccacaa1c4c9dfce1ce6ca26d6 100644 (file)
@@ -27,3 +27,36 @@ mainly a wrapper around `ovs-ctl` and `ovn-ctl` with simple knobs from
        /etc/init.d/openvswitch status
 
 Use `ovs-ctl` and `ovn-ctl` directly for more functionalities
+
+# Open vSwitch in-tree Linux datapath modules
+
+The Open vSwitch build system uses regexp and conditional-compilation
+heuristics to support building the shipped kernel module source code against a
+wide range of kernels, as of openvswitch-2.10, the list is supposed to include
+vanilla linux 3.10 to 4.15, plus a few distro kernels.
+
+It may NOT work
+
+ - Sometimes the code does not compile
+ - Sometimes the code compiles but insmod will fail
+ - Sometimes modules are loaded okay but actually does not function right
+
+For these reasons, the in-tree datapath modules are NOT visible/enabled by
+default.
+
+Building and using in-tree datapath modules requires some level of devel
+abilities to proceed.  You are expected to configure build options and build
+the code on your own
+
+E.g. pair openvswitch userspace with in-tree datapath module
+
+       CONFIG_DEVEL=y
+       CONFIG_PACKAGE_openvswitch=y
+       # CONFIG_PACKAGE_kmod-openvswitch is not set
+       CONFIG_PACKAGE_kmod-openvswitch-intree=y
+
+E.g. replace in-tree datapath module with upstream version
+
+       opkg remove --force-depends kmod-openvswitch-intree
+       opkg install kmod-openvswitch
+       ovs-ctl force-reload-kmod
index 3af1b1e405a39eb2767196603e0c95d29ffcb922..f504bb63a30ad75d99544ca37b2e8f747b34f54c 100755 (executable)
@@ -6,8 +6,8 @@
 START=15
 
 ovs_script_dir=/usr/share/openvswitch/scripts
-ovs_ctl="$ovs_script_dir/ovs-ctl"
-ovn_ctl="$ovs_script_dir/ovn-ctl"
+ovs_ctl="$ovs_script_dir/ovs-ctl"; [ -x "$ovs_ctl" ] || ovs_ctl=:
+ovn_ctl="$ovs_script_dir/ovn-ctl"; [ -x "$ovn_ctl" ] || ovn_ctl=:
 
 EXTRA_COMMANDS=status
 
index 20f3446125966bbbeb06e13b30f74d2cb3592da2..88ae72429cc4ad1fdad8a56d86281905d2e0df3b 100755 (executable)
@@ -3,6 +3,7 @@
 s=/usr/share/openvswitch/scripts
 case "$0" in
        *ovs-ctl) "$s/ovs-ctl" "$@" ;;
+       *ovs-kmod-ctl) "$s/ovs-kmod-ctl" "$@" ;;
        *ovn-ctl) "$s/ovn-ctl" "$@" ;;
        *) exit 1;;
 esac
index 0c7022d6e751aa2fe72b2d3f5e705f0f825c41b3..9c2a154e973108bc3de3c2a1cf7541356b2e794d 100644 (file)
@@ -1,7 +1,7 @@
-From 054968d5748c9ff73a69155cd64f0e81287d3bb3 Mon Sep 17 00:00:00 2001
+From e4ac9741a99866976322c21605b312bc27633c92 Mon Sep 17 00:00:00 2001
 From: Helmut Schaa <helmut.schaa@googlemail.com>
 Date: Wed, 8 Jan 2014 13:48:33 +0100
-Subject: [PATCH 100/105] netdev-linux: Use unsigned int for ifi_flags
+Subject: [PATCH 100/107] netdev-linux: Use unsigned int for ifi_flags
 
 ifi_flags is unsigned, the local equivalents should do the same.
 
index 29fbc14b20a6d4d4b99654eb2e8082070586d573..45770b7c784d0ab5ff6b3c21509805de400935d0 100644 (file)
@@ -1,7 +1,7 @@
-From a3eabe1e639c98ce8537df4ac4187a8c047dac59 Mon Sep 17 00:00:00 2001
+From 9f4775d9a2541e8128ea99f3b02925cc1ee05374 Mon Sep 17 00:00:00 2001
 From: Helmut Schaa <helmut.schaa@googlemail.com>
 Date: Wed, 8 Jan 2014 13:48:49 +0100
-Subject: [PATCH 101/105] netdev-linux: Let interface flag survive internal
+Subject: [PATCH 101/107] netdev-linux: Let interface flag survive internal
  port setup
 
 Due to a race condition when bringing up an internal port on Linux
index 01368beac0cc33f582061c45a5c6f305aed489cc..e403f266699b7dacaa8dbcc36d8092a92ba0b24b 100644 (file)
@@ -1,7 +1,7 @@
-From b5c6d8c2e1ba0c3d9b93622f68f6c0b9e9c62f0d Mon Sep 17 00:00:00 2001
+From e451d74788c73e8679e6a2268185a08901ac7f8c Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 12:21:05 +0000
-Subject: [PATCH 102/105] python: separate host/target python for cross-compile
+Subject: [PATCH 102/107] python: separate host/target python for cross-compile
 
 At the moment, python-six is a requirement for openvswitch python
 library on target machine.
index 8124fd843be6ecad89d476a8029c4c9132222721..5910a6b0f770391567e0ac20c0c4ad98acf6f510 100644 (file)
@@ -1,7 +1,7 @@
-From 0b8ef58a26ed8d426acfe1fa27713cbcc2427f3f Mon Sep 17 00:00:00 2001
+From 6b9732c8851c5466f2a363d88b5acae320801efe Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <yszhou4tech@gmail.com>
 Date: Wed, 14 Mar 2018 16:40:01 +0800
-Subject: [PATCH 103/105] ovs-ctl: fix setting hostname
+Subject: [PATCH 103/107] ovs-ctl: fix setting hostname
 
 The command "hostname" is not available in OpenWrt by default.
 
index e1a40d0b5019d80c0beea17c5068c92d4255084f..86c329f556e1c0b782ab3f7096711ef7802365fe 100644 (file)
@@ -1,7 +1,7 @@
-From 97107da940da7814c3e9e947aee1c247cd7b95db Mon Sep 17 00:00:00 2001
+From 940441e2982cb35765830060e8203e5dd1a0f967 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <yszhou4tech@gmail.com>
 Date: Wed, 14 Mar 2018 16:44:13 +0800
-Subject: [PATCH 104/105] ovs-lib: fix install_dir()
+Subject: [PATCH 104/107] ovs-lib: fix install_dir()
 
 The command "install" is not available in OpenWrt by default
 
index 4d52a4c1771ab038935711b9607fe0a34d4c3868..424b85a05631f5d1367a07833b2e509f6c0ed2b2 100644 (file)
@@ -1,7 +1,7 @@
-From f5c6e5d4c567f3705de503b7271d384d1aad88ab Mon Sep 17 00:00:00 2001
+From d0cad5ac122aca722dc2013c1f53fda44c477cf2 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 13:02:21 +0000
-Subject: [PATCH 105/105] build: disable building tests
+Subject: [PATCH 105/107] build: disable building tests
 
 Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
 ---
diff --git a/net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch b/net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch
new file mode 100644 (file)
index 0000000..412cad3
--- /dev/null
@@ -0,0 +1,26 @@
+From 2a59f2b60e8a22dc93d48c511b5c4255b429ff66 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <zhouyousong@yunionyun.com>
+Date: Wed, 5 Sep 2018 12:32:54 +0000
+Subject: [PATCH 106/107] ovs-save: compatible with busybox ip command
+
+Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
+use `ip rule list` to cover both iproute2 and busybox ip command
+
+Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
+---
+ utilities/ovs-save | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utilities/ovs-save b/utilities/ovs-save
+index ea8fb6a45..72d460df4 100755
+--- a/utilities/ovs-save
++++ b/utilities/ovs-save
+@@ -38,7 +38,7 @@ EOF
+ }
+ save_interfaces () {
+-    if (ip -V) > /dev/null 2>&1; then :; else
++    if (ip rule list) > /dev/null 2>&1; then :; else
+         echo "$0: ip not found in $PATH" >&2
+         exit 1
+     fi
diff --git a/net/openvswitch/patches/0107-datapath-use-KARCH-when-building-linux-datapath-modu.patch b/net/openvswitch/patches/0107-datapath-use-KARCH-when-building-linux-datapath-modu.patch
new file mode 100644 (file)
index 0000000..ddfc397
--- /dev/null
@@ -0,0 +1,28 @@
+From 1e859f407b94a0f549fc41fceec11ca12653878b Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <zhouyousong@yunionyun.com>
+Date: Thu, 6 Sep 2018 11:48:20 +0000
+Subject: [PATCH 107/107] datapath: use KARCH when building linux datapath
+ modules
+
+Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
+---
+ datapath/linux/Makefile.main.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/datapath/linux/Makefile.main.in b/datapath/linux/Makefile.main.in
+index 7d18253be..039485d16 100644
+--- a/datapath/linux/Makefile.main.in
++++ b/datapath/linux/Makefile.main.in
+@@ -68,10 +68,10 @@ ifeq (,$(wildcard $(CONFIG_FILE)))
+ endif
+ default:
+-      $(MAKE) -C $(KSRC) M=$(builddir) modules
++      $(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules
+ modules_install:
+-      $(MAKE) -C $(KSRC) M=$(builddir) modules_install
++      $(MAKE) -C $(KSRC) $(if @KARCH@,ARCH=@KARCH@) M=$(builddir) modules_install
+       depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h`
+ endif
index 340000067f5a088ed78af8f4a0ac7b6de8f63a12..bfb2eda1a80969bc7fc932e6a1e6d6d3f17d3ef6 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=radsecproxy
-PKG_VERSION:=1.7.1
+PKG_VERSION:=1.7.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/radsecproxy/radsecproxy/releases/download/$(PKG_VERSION)/
-PKG_HASH:=49fd644684c6ea502d896d31e29f1acf2ae9b61b02b231a8ffd0cec11857dd07
+PKG_HASH:=2cf23e618ab9275221350acf5a97bce4ff18aee472045f8a3b4c7673491079d2
 
-PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE:=BSD-3-CLAUSE
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_FIXUP:=autoreconf
diff --git a/net/radsecproxy/patches/100-fix-debug-tid.patch b/net/radsecproxy/patches/100-fix-debug-tid.patch
deleted file mode 100644 (file)
index c170e3f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/debug.c
-+++ b/debug.c
-@@ -153,7 +153,7 @@ void debug_logit(uint8_t level, const ch
-     if (debug_tid) {
-         tidbuf = malloc((3*sizeof(pthread_t)+5)+strlen(format));
--        sprintf(tidbuf, "(%ld) %s", pthread_self(), format);
-+        sprintf(tidbuf, "(%ld) %s", (long int)pthread_self(), format);
-         format = tidbuf;
-     } else
-         tidbuf = NULL;
index 95fd470d0dd39774a8c3dff0585aea78dc29562a..55bece836772bafeb8ca02b781cbb74534ae3549 100644 (file)
@@ -8,19 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rsyslog
-PKG_VERSION:=8.18.0
-PKG_RELEASE:=1
+PKG_VERSION:=8.37.0
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.rsyslog.com/files/download/rsyslog/
-PKG_HASH:=94346237ecfa22c9f78cebc3f18d59056f5d9846eb906c75beaa7e486f02c695
+PKG_SOURCE_URL:=https://www.rsyslog.com/files/download/rsyslog/
+PKG_HASH:=295c289b4c8abd8f8f3fe35a83249b739cedabe82721702b910255f9faf147e7
 
-PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
+PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
-PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -28,7 +28,7 @@ define Package/rsyslog
   SECTION:=net
   CATEGORY:=Network
   TITLE:=Enhanced system logging and kernel message trapping daemons
-  URL:=http://www.rsyslog.com/
+  URL:=https://www.rsyslog.com/
   DEPENDS:=+libestr +libfastjson +libuuid +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt
 endef
 
@@ -38,10 +38,9 @@ endef
 
 CONFIGURE_ARGS+= \
        --disable-libgcrypt \
-       --disable-liblogging-stdlog
-
-TARGET_CFLAGS += \
-       -std=c99
+       --disable-fmhttp \
+       --disable-default-tests \
+       --disable-libsystemd
 
 define Package/rsyslog/install
        $(INSTALL_DIR) $(1)/usr/sbin
index 404f62a4b723ef00df3be0f16b329019eafea832..c59c7b291e8c899f919b582e0173c08688a8d4e1 100644 (file)
@@ -30,17 +30,18 @@ config SAMBA4_SERVER_AD_DC
 config SAMBA4_SERVER_AVAHI
        bool "Avahi support"
        depends on PACKAGE_samba4-server
+       select SAMBA4_SERVER_VFS
        select PACKAGE_libavahi-client
        help
-               Announce Samba resources via DNS/DNS-SD using the Avahi daemon
-       default n
+               Announce Samba resources via DNS/DNS-SD using the Avahi daemon, for Linux/Mac clients.
+       default y
 
 config SAMBA4_SERVER_VFS
        bool "Common VFS modules"
        depends on PACKAGE_samba4-server
        help
                installs:
-                       modules: (vfs_btrfs) vfs_fruit vfs_shadow_copy2 vfs_recycle vfs_fake_perms vfs_readonly vfs_cap vfs_offline vfs_crossrename
+                       modules: (vfs_btrfs) vfs_fruit vfs_shadow_copy2 vfs_recycle vfs_fake_perms vfs_readonly vfs_cap vfs_offline vfs_crossrename vfs_catia vfs_streams_xattr
 
                Commonly used VFS modules, vfs_btrfs requires kmod-fs-btrfs to be selected separately
         default y
@@ -60,7 +61,7 @@ config SAMBA4_SERVER_VFSX
        depends on PACKAGE_samba4-server
        help
                installs:
-                       modules: vfs_virusfilter vfs_shell_snap vfs_commit vfs_worm vfs_xattr_tdb vfs_streams_xattr vfs_aio_fork vfs_aio_pthread (vfs_linux_xfs_sgid) vfs_netatalk vfs_dirsort vfs_fileid vfs_catia
+                       modules: vfs_virusfilter vfs_shell_snap vfs_commit vfs_worm vfs_xattr_tdb vfs_aio_fork vfs_aio_pthread (vfs_linux_xfs_sgid) vfs_netatalk vfs_dirsort vfs_fileid
 
                Additional VFS modules that aren't commonly used, vfs_linux_xfs_sgid requires kmod-fs-xfs to be selected separately
        default n
index c029bff4cc7484dd7bab55cf49268c56068001b6..56d9475c52d134e50cda641c3581013a6e8e522c 100644 (file)
@@ -2,8 +2,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=samba
-PKG_VERSION:=4.8.4
-PKG_RELEASE:=1
+PKG_VERSION:=4.9.0
+PKG_RELEASE:=2
 
 PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-3.0-only
@@ -11,7 +11,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE_URL:=https://download.samba.org/pub/samba/stable/
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=f5044d149e01894a08b1d114b8b69aed78171a7bb19608bd1fd771453b9a5406
+PKG_HASH:=d071e9e738e9583d0b9ce1c758d46808b76078405787c88a0c5b465bef8a9b15
 
 # Buildroot bug? Can't add target deps via '+SAMBA4_SERVER_AD_DC:python-crypto' (as work-around we select via config.in)
 PKG_BUILD_DEPENDS:=SAMBA4_SERVER_AD_DC:python-crypto nfs-kernel-server/host
@@ -51,12 +51,12 @@ define Package/samba4-libs
   $(call Package/samba4/Default)
   TITLE+= libs
   DEPENDS:= +zlib +libtirpc +krb5-libs +libpopt \
-       +PACKAGE_libcap:libcap +PACKAGE_jansson:jansson +PACKAGE_libpthread:libpthread +PACKAGE_libnettle:libnettle \
-       +PACKAGE_libarchive:libarchive +PACKAGE_libgcrypt:libgcrypt +PACKAGE_libpam:libpam +PACKAGE_dbus:dbus +PACKAGE_libavahi-client:libavahi-client \
+       +PACKAGE_libcap:libcap +PACKAGE_libpthread:libpthread +PACKAGE_libnettle:libnettle \
+       +PACKAGE_libgcrypt:libgcrypt +PACKAGE_libpam:libpam +PACKAGE_dbus:dbus +PACKAGE_libavahi-client:libavahi-client \
        +SAMBA4_SERVER_VFS:attr \
        +SAMBA4_SERVER_ACL:acl +SAMBA4_SERVER_ACL:attr \
        +SAMBA4_SERVER_AVAHI:libavahi-client \
-       +SAMBA4_SERVER_AD_DC:python-base +SAMBA4_SERVER_AD_DC:libopenssl +SAMBA4_SERVER_AD_DC:libgnutls +SAMBA4_SERVER_AD_DC:libopenldap
+       +SAMBA4_SERVER_AD_DC:python-base +SAMBA4_SERVER_AD_DC:libopenssl +SAMBA4_SERVER_AD_DC:libgnutls +SAMBA4_SERVER_AD_DC:libopenldap +SAMBA4_SERVER_AD_DC:jansson +SAMBA4_SERVER_AD_DC:libarchive
 endef
 
 define Package/samba4-server
@@ -158,7 +158,11 @@ CONFIGURE_ARGS += \
 
 # Optional AES-NI support - https://lists.samba.org/archive/samba-technical/2017-September/122738.html
 # Support for Nettle wasn't comitted
-CONFIGURE_ARGS += --accel-aes=none
+ifdef CONFIG_TARGET_x86_64
+       CONFIGURE_ARGS += --accel-aes=intelaesni
+else
+       CONFIGURE_ARGS += --accel-aes=none
+endif
 
 CONFIGURE_ARGS += \
                --with-lockdir=/var/lock \
@@ -192,7 +196,7 @@ ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
        CONFIGURE_ARGS += --enable-gnutls --with-dnsupdate --with-ads --with-ldap
        TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/python2.7 $(TARGET_CFLAGS)
 else
-       CONFIGURE_ARGS += --without-ad-dc --disable-python --nopyc --nopyo --disable-gnutls --without-dnsupdate --without-ads --without-ldap
+       CONFIGURE_ARGS += --without-ad-dc --without-json-audit --without-libarchive --disable-python --nopyc --nopyo --disable-gnutls --without-dnsupdate --without-ads --without-ldap
        CONFIGURE_VARS += \
                python_LDFLAGS="" \
                python_LIBDIR=""
@@ -209,13 +213,13 @@ SAMBA4_PDB_MODULES :=pdb_smbpasswd,pdb_tdbsam,
 SAMBA4_AUTH_MODULES :=auth_builtin,auth_sam,auth_unix,auth_script,
 SAMBA4_VFS_MODULES :=vfs_default,
 ifeq ($(CONFIG_SAMBA4_SERVER_VFS),y)
-       SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_fruit,vfs_shadow_copy2,vfs_recycle,vfs_fake_perms,vfs_readonly,vfs_cap,vfs_offline,vfs_crossrename,vfs_catia,vfs_streams_xattr,
+       SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_fruit,vfs_shadow_copy2,vfs_recycle,vfs_fake_perms,vfs_readonly,vfs_cap,vfs_offline,vfs_crossrename,vfs_catia,vfs_streams_xattr,vfs_xattr_tdb,
 ifeq ($(CONFIG_PACKAGE_kmod-fs-btrfs),y)
        SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_btrfs,
 endif
 endif
 ifeq ($(CONFIG_SAMBA4_SERVER_VFSX),y)
-       SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_virusfilter,vfs_shell_snap,vfs_commit,vfs_worm,vfs_xattr_tdb,vfs_aio_fork,vfs_aio_pthread,vfs_netatalk,vfs_dirsort,vfs_fileid,
+       SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_virusfilter,vfs_shell_snap,vfs_commit,vfs_worm,vfs_aio_fork,vfs_aio_pthread,vfs_netatalk,vfs_dirsort,vfs_fileid,
 ifeq ($(CONFIG_PACKAGE_kmod-fs-xfs),y)
        SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_linux_xfs_sgid,
 endif
@@ -231,6 +235,7 @@ endif
 ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
        SAMBA4_PDB_MODULES :=$(SAMBA4_PDB_MODULES)pdb_samba_dsdb,
        SAMBA4_AUTH_MODULES :=$(SAMBA4_AUTH_MODULES)auth_samba4,
+       SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_audit,vfs_extd_audit,vfs_full_audit,
 endif
 ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
        SAMBA4_IDMAP_MODULES :=$(SAMBA4_IDMAP_MODULES)idmap_passdb,idmap_nss,idmap_tdb,idmap_tdb2,idmap_script,nss_info_template,
@@ -271,10 +276,9 @@ BUILD_TARGETS_ADMIN :=net,smbcontrol,profiles,rpcclient,smbcacls,smbcquotas
 BUILD_TARGETS_UTILS :=smbstatus,smbtree,smbget,mvxattr,nmblookup
 
 # lib bundling
-# NOTE: Compile some unique libs into related bins, so we end-up with a unified samba4-libs base, mainly to allow package separation (server, client, admin, utils)
-CONFIGURE_ARGS += --builtin-libraries=smbclient,netapi,samba-passdb,ads,auth,cli-spoolss,libcli-lsa3,gpext,talloc,tevent,texpect,tdb,ldb,tdr,cmocka,replace
-#CONFIGURE_ARGS += --nonshared-binary=$(BUILD_TARGETS_SERVER)
 # NOTE: bundle + make private, we want to avoid version configuration (build, link) conflicts
+CONFIGURE_ARGS += --builtin-libraries=talloc,tevent,texpect,tdb,ldb,tdr,cmocka,replace
+#CONFIGURE_ARGS += --nonshared-binary=$(BUILD_TARGETS_SERVER)
 ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
 CONFIGURE_ARGS += --bundled-libraries=talloc,tevent,texpect,tdb,ldb,tdr,cmocka,replace,pytalloc-util,pyldb-util,NONE
 else
@@ -356,8 +360,8 @@ define Package/samba4-server/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smbd $(1)/usr/sbin/
 ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7 $(1)/usr/lib/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{samba-tool,ntlm_auth} $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{samba,samba_gpoupdate,samba_dnsupdate,samba_kcc,samba_spnupdate,samba_upgradedns} $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{samba-tool,ntlm_auth,smbtar} $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{samba,samba-gpupdate,samba_dnsupdate,samba_kcc,samba_spnupdate,samba_upgradedns} $(1)/usr/sbin/
 endif
 ifeq ($(CONFIG_SAMBA4_SERVER_NETBIOS),y)
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nmbd $(1)/usr/sbin/
index 9487875be6321d02b534b4203977ee6fadba0c5c..6462a32e27678968d66ab997b9765e4b9723a857 100644 (file)
@@ -22,11 +22,12 @@ smb_header() {
        local name workgroup description charset
        local hostname="$(uci_get system.@system[0].hostname)"
 
-       config_get name                 $1 name         "${hostname:-OpenWrt}"
-       config_get workgroup            $1 workgroup    "${hostname:-WORKGROUP}"
-       config_get description          $1 description  "Samba on ${hostname:-OpenWrt}"
-       config_get charset              $1 charset      "UTF-8"
-
+       config_get name                         $1 name                 "${hostname:-OpenWrt}"
+       config_get workgroup            $1 workgroup    "${hostname:-WORKGROUP}"
+       config_get description          $1 description  "Samba on ${hostname:-OpenWrt}"
+       config_get charset                      $1 charset              "UTF-8"
+       
+       config_get_bool MACOS                   $1 macos                        0
        config_get_bool DISABLE_NETBIOS $1 disable_netbios      0
        config_get_bool DISABLE_AD_DC   $1 disable_ad_dc        0
        config_get_bool DISABLE_WINBIND $1 disable_winbind      0
@@ -65,43 +66,44 @@ smb_add_share() {
        local name
        local path
        local users
-       local public
-       local writable
-       local printable
        local create_mask
-
+       local dir_mask
        local browseable
        local read_only
        local guest_ok
        local guest_only
        local inherit_owner
        local vfs_objects
+       local timemachine
+       local timemachine_maxsize
+       local force_root
 
        config_get name $1 name
        config_get path $1 path
        config_get users $1 users
-       config_get public $1 public
-       config_get writable $1 writable
-       config_get printable $1 printable
        config_get create_mask $1 create_mask
        config_get dir_mask $1 dir_mask
-
-
        config_get browseable $1 browseable
        config_get read_only $1 read_only
        config_get guest_ok $1 guest_ok
        config_get guest_only $1 guest_only
        config_get inherit_owner $1 inherit_owner
        config_get vfs_objects $1 vfs_objects
-
+       config_get_bool timemachine     $1 timemachine  0
+       config_get timemachine_maxsize $1 timemachine_maxsize
+       config_get_bool force_root      $1 force_root   0
 
        [ -z "$name" -o -z "$path" ] && return
 
        echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf
-       [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf
-       [ -n "$public" ] && echo -e "\tpublic = $public" >> /var/etc/smb.conf
-       [ -n "$writable" ] && echo -e "\twritable = $writable" >> /var/etc/smb.conf
-       [ -n "$printable" ] && echo -e "\tprintable = $printable" >> /var/etc/smb.conf
+       
+       if [ "$force_root" -eq 1 ]; then
+               echo -e "\tforce user = root" >> /var/etc/smb.conf
+               echo -e "\tforce group = root" >> /var/etc/smb.conf
+       else
+               [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf
+       fi
+
        [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf
        [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf
 
@@ -110,6 +112,19 @@ smb_add_share() {
        [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf
        [ -n "$guest_only" ] && echo -e "\tguest only = $guest_only" >> /var/etc/smb.conf
        [ -n "$inherit_owner" ] && echo -e "\tinherit owner = $inherit_owner" >> /var/etc/smb.conf
+       
+       if [ "$MACOS" -eq 1 ]; then
+               vfs_objects="catia fruit streams_xattr $vfs_objects"
+               echo -e "\tfruit:encoding = native" >> /var/etc/smb.conf
+               echo -e "\tfruit:metadata = stream" >> /var/etc/smb.conf
+               echo -e "\tfruit:veto_appledouble = no" >> /var/etc/smb.conf
+               # avoid mixed shares order for aapl
+               if [ "$timemachine" -eq 1 ]; then
+                       echo -e "\tfruit:time machine = yes" >> /var/etc/smb.conf
+                       [ -n "$timemachine_maxsize" ] && echo -e "\tfruit:time machine max size = ${timemachine_maxsize}G" >> /var/etc/smb.conf
+               fi
+       fi
+       
        [ -n "$vfs_objects" ] && echo -e "\tvfs objects = $vfs_objects" >> /var/etc/smb.conf
 }
 
@@ -150,7 +165,7 @@ service_triggers() {
 start_service() {
        init_config
 
-       # start main AC-DC daemon, will spawn (smbd,nmbd,winbindd) as needed/configured.
+       # start main AD-DC daemon, will spawn (smbd,nmbd,winbindd) as needed/configured.
        if [ "$DISABLE_AD_DC" -ne 1 ] && [ -x /usr/sbin/samba ]; then
                procd_open_instance
                procd_set_param command /usr/sbin/samba -F
index 77f4e9675edf3d7297a83a510a2c5a4688ab65dd..9c18184b3f439774629ada98722ab1b174fee18c 100644 (file)
        ## disable loading of all printcap printers by default (iprint, cups, lpstat)
        load printers = No
        printcap name = /dev/null
+
+       ## Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's.
+       disable spoolss = yes
+       
+       ## This parameters controls how printer status information is interpreted on your system.
+       ## (BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ)
+       printing = bsd
        
        ## Disable that nmbd is acting as a WINS server for unknow netbios names
        #dns proxy = No
@@ -62,7 +69,7 @@
        ## Allows the server name that is advertised through MDNS to be set to the hostname rather than the Samba NETBIOS name.
        ## This allows an administrator to make Samba registered MDNS records match the case of the hostname rather than being in all capitals.
        ## (netbios, mdns)
-       #mdns name = mdns
+       mdns name = mdns
        
        ## Clients that only support netbios won't be able to see your samba server when netbios support is disabled.
        #disable netbios = Yes
diff --git a/net/samba4/patches/103-samba-4.8.5-unbundle-libbsd.patch b/net/samba4/patches/103-samba-4.8.5-unbundle-libbsd.patch
new file mode 100644 (file)
index 0000000..1fc2f76
--- /dev/null
@@ -0,0 +1,78 @@
+--- a/lib/crypto/wscript_configure     2018-07-26
++++ b/lib/crypto/wscript_configure     2018-08-27
+@@ -2,11 +2,11 @@
+ import Options
+ import Utils
+-if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
+-    checklibc=True):
+-    conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
+-                        checklibc=True)
+-    conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
++# if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
++    # checklibc=True):
++conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
++                                      checklibc=True)
++conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
+                         checklibc=True)
+ conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
+     checklibc=True)
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -302,22 +302,13 @@ def configure(conf):
+     conf.CHECK_FUNCS('prctl dirname basename')
+-    strlcpy_in_bsd = False
+-
+-    # libbsd on some platforms provides strlcpy and strlcat
+-    if not conf.CHECK_FUNCS('strlcpy strlcat'):
+-        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+-                               checklibc=True):
+-            strlcpy_in_bsd = True
+-    if not conf.CHECK_FUNCS('getpeereid'):
+-        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+-        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-    if not conf.CHECK_FUNCS('setproctitle_init'):
+-        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+-    if not conf.CHECK_FUNCS('closefrom'):
+-        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++    # Not checking for libbsd
++    conf.CHECK_FUNCS('strlcpy strlcat')
++    conf.CHECK_FUNCS('getpeereid')
++    conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
++    conf.CHECK_FUNCS('setproctitle_init')
++
++    conf.CHECK_FUNCS('closefrom')
+     conf.CHECK_CODE('''
+                 struct ucred cred;
+@@ -667,9 +658,6 @@ removeea setea
+     # look for a method of finding the list of network interfaces
+     for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+-        bsd_for_strlcpy = ''
+-        if strlcpy_in_bsd:
+-            bsd_for_strlcpy = ' bsd'
+         if conf.CHECK_CODE('''
+                            #define %s 1
+                            #define NO_CONFIG_H 1
+@@ -682,7 +670,7 @@ removeea setea
+                            #include "test/getifaddrs.c"
+                            ''' % method,
+                            method,
+-                           lib='nsl socket' + bsd_for_strlcpy,
++                           lib='nsl socket',
+                            addmain=False,
+                            execute=True):
+             break
+@@ -730,7 +718,6 @@ def build(bld):
+                 break
+     extra_libs = ''
+-    if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'
+     bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',
+         REPLACE_HOSTCC_SOURCE,
index f20b9eb5aeaf8011a3f1251d05fba8f62447a397..9aae22c36a96309415fff371504853120d6058c1 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index babfa411725f848ea5cda5aa0fdb3753c17bb081..57f38119ff865fc858d5e1dace394b84e06ee0fe 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 10e7fe397ff40bfe1f32e79822c8c9711bf101f1..79ba994be2b01d4745466d69fe692a4b02c3a6c6 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 10e7fe397ff40bfe1f32e79822c8c9711bf101f1..79ba994be2b01d4745466d69fe692a4b02c3a6c6 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 10e7fe397ff40bfe1f32e79822c8c9711bf101f1..79ba994be2b01d4745466d69fe692a4b02c3a6c6 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 6f6f410c219a97b84b5199b90f058a1716bbf2b4..9c1a2c67ef489c92d82613a0a873ee0ab46ec054 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "128"
 Checking value of _NSIG: "128"
 Checking value of SIGRTMAX: "127"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 313c5d9f2d2a019c2649e74e324da561bc286a2a..a270f0860c06999f54abd481fc8fe25d0235ac07 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "128"
 Checking value of _NSIG: "128"
 Checking value of SIGRTMAX: "127"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 313c5d9f2d2a019c2649e74e324da561bc286a2a..a270f0860c06999f54abd481fc8fe25d0235ac07 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "128"
 Checking value of _NSIG: "128"
 Checking value of SIGRTMAX: "127"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 6f6f410c219a97b84b5199b90f058a1716bbf2b4..9c1a2c67ef489c92d82613a0a873ee0ab46ec054 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "128"
 Checking value of _NSIG: "128"
 Checking value of SIGRTMAX: "127"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 819f1854db426d35ac778065c6f53ecd5740facb..4912acbde984869ae01095b9292e62a0329fff86 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index f20b9eb5aeaf8011a3f1251d05fba8f62447a397..9aae22c36a96309415fff371504853120d6058c1 100644 (file)
@@ -16,6 +16,7 @@ Checking value of NSIG: "65"
 Checking value of _NSIG: "65"
 Checking value of SIGRTMAX: "64"
 Checking value of SIGRTMIN: "35"
+Checking for a 64-bit host to support lmdb: NO
 Checking whether the WRFILE -keytab is supported: OK
 Checking errno of iconv for illegal multibyte sequence: OK
 Checking for kernel change notify support: OK
index 8a28c792f234d3367c4ce409110a3a134d5cdbf0..be57601071994202428f126834a9e15735b953b2 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2006-2015 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=socat
 PKG_VERSION:=1.7.3.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download
@@ -63,11 +61,23 @@ ifneq ($(CONFIG_SOCAT_SSL),y)
   CONFIGURE_ARGS+= --disable-openssl
 endif
 
+# PowerPC has different TERMIOS bits
+ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
+  CONFIGURE_VARS += \
+         sc_cv_sys_crdly_shift=12 \
+         sc_cv_sys_tabdly_shift=10 \
+         sc_cv_sys_csize_shift=8
+else
+  CONFIGURE_VARS += \
+         sc_cv_sys_crdly_shift=9 \
+         sc_cv_sys_tabdly_shift=11 \
+         sc_cv_sys_csize_shift=4
+endif
+
 CONFIGURE_VARS += \
        sc_cv_termios_ispeed="no" \
-       sc_cv_sys_crdly_shift=9 \
-       sc_cv_sys_tabdly_shift=11 \
-       sc_cv_sys_csize_shift=4 \
+       ac_cv_header_bsd_libutil_h=no \
+       ac_cv_lib_bsd_openpty=no \
        BUILD_DATE=$(SOURCE_DATE_EPOCH)
 
 define Package/socat/install
diff --git a/net/spoofer/Makefile b/net/spoofer/Makefile
new file mode 100644 (file)
index 0000000..60ee979
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2018 The Regents of the University of California
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=spoofer
+PKG_VERSION:=1.3.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.caida.org/projects/spoofer/downloads
+PKG_HASH:=376f9a4b2d0404de3c37df645672a954b4916ad56508fadfe3f99120e5b0f87e
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE
+
+HOST_BUILD_DEPENDS:=protobuf/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+$(eval $(call HostBuild))
+
+define Package/spoofer
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Measure your ISP's resistance to spoofed IP packets
+  URL:=https://spoofer.caida.org/
+  MAINTAINER:=Ken Keys <spoofer-info@caida.org>
+  DEPENDS:=+protobuf-lite +libpcap +libpthread +libopenssl
+endef
+
+define Package/spoofer/description
+The spoofer client is part of a system to measure the Internet's
+resistance to packets with a spoofed (forged) source IP address.
+
+This package comes bundled with a small certificate file that allows
+secure communication with the spoofer server without depending on
+the large ca-certificates package.  But if the server's private
+certificate ever changes, it will be necessary to either install the
+ca-certificates package or install an updated version of this package
+that has a newer bundled certificate.
+
+endef
+
+CONFIGURE_ARGS += \
+       --enable-prober \
+       --disable-manager
+
+CONFIGURE_VARS += \
+       PROTOC=$(STAGING_DIR_HOSTPKG)/bin/protoc
+
+EXTRA_CXXFLAGS += -std=gnu++14
+
+SPOOFER_SRC=$(PKG_BUILD_DIR)
+
+define Package/spoofer/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/prober/spoofer-prober $(1)/usr/bin
+       $(INSTALL_BIN) $(SPOOFER_SRC)/openwrt-files/spoofer $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(SPOOFER_SRC)/openwrt-files/initscript $(1)/etc/init.d/spoofer
+       $(INSTALL_DIR) $(1)/usr/share/spoofer
+       $(INSTALL_DATA) $(SPOOFER_SRC)/gd_bundle.crt $(1)/usr/share/spoofer
+       $(INSTALL_DATA) $(SPOOFER_SRC)/openwrt-files/spoofer-lib.sh $(1)/usr/share/spoofer
+endef
+
+$(eval $(call BuildPackage,spoofer))
index 753bd8e8d68421423d25a17b9d6c86c6f721dc65..8db92215e6a4642ccc882856ef5b610475b78297 100644 (file)
 +#undef encrypt
 --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
 +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
-@@ -19,6 +19,7 @@
+@@ -40,6 +40,7 @@
   */
  
  #define _GNU_SOURCE
 +#include <musl.h>
  #include <sys/types.h>
  #include <sys/socket.h>
- #include <stdint.h>
+ #include <sys/ioctl.h>
 --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
 +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
 @@ -37,6 +37,8 @@
index 8e54050defc21debdfd42d8bfc9450d020cb3a35..a61da3a48f49d2e66499f006d9130619291d0489 100644 (file)
@@ -9,7 +9,7 @@
 +# This files/scripts are executed by the openwrt hotplug functionality on
 +# ipsec events.
 +
-+exec /sbin/hotplug-call ipsec "$1"
++/sbin/hotplug-call ipsec "$1"
 +
  #      PLUTO_VERSION
  #              indicates  what  version of this interface is being
index eb8d83c4a3b7aaa0f5a99162c0bbf3ea7871d346..14a1de5788ec04f486a589edfbc2353529e40b84 100644 (file)
@@ -8,7 +8,7 @@
  ARG_DISBL_SET([curve25519],     [disable Curve25519 Diffie-Hellman plugin.])
  ARG_DISBL_SET([hmac],           [disable HMAC crypto implementation plugin.])
  ARG_ENABL_SET([md4],            [enable MD4 software implementation plugin.])
-@@ -1379,6 +1380,7 @@ ADD_PLUGIN([gcrypt],               [s ch
+@@ -1407,6 +1408,7 @@ ADD_PLUGIN([gcrypt],               [s ch
  ADD_PLUGIN([af-alg],               [s charon scepclient pki scripts medsrv attest nm cmd aikgen])
  ADD_PLUGIN([fips-prf],             [s charon nm cmd])
  ADD_PLUGIN([gmp],                  [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen fuzz])
@@ -16,7 +16,7 @@
  ADD_PLUGIN([curve25519],           [s charon pki scripts nm cmd])
  ADD_PLUGIN([agent],                [s charon nm cmd])
  ADD_PLUGIN([keychain],             [s charon cmd])
-@@ -1516,6 +1518,7 @@ AM_CONDITIONAL(USE_SHA3, test x$sha3 = x
+@@ -1547,6 +1549,7 @@ AM_CONDITIONAL(USE_SHA3, test x$sha3 = x
  AM_CONDITIONAL(USE_MGF1, test x$mgf1 = xtrue)
  AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
  AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
@@ -24,7 +24,7 @@
  AM_CONDITIONAL(USE_CURVE25519, test x$curve25519 = xtrue)
  AM_CONDITIONAL(USE_RDRAND, test x$rdrand = xtrue)
  AM_CONDITIONAL(USE_AESNI, test x$aesni = xtrue)
-@@ -1783,6 +1786,7 @@ AC_CONFIG_FILES([
+@@ -1823,6 +1826,7 @@ AC_CONFIG_FILES([
        src/libstrongswan/plugins/mgf1/Makefile
        src/libstrongswan/plugins/fips_prf/Makefile
        src/libstrongswan/plugins/gmp/Makefile
@@ -34,7 +34,7 @@
        src/libstrongswan/plugins/aesni/Makefile
 --- a/src/libstrongswan/Makefile.am
 +++ b/src/libstrongswan/Makefile.am
-@@ -323,6 +323,13 @@ if MONOLITHIC
+@@ -341,6 +341,13 @@ if MONOLITHIC
  endif
  endif
  
index 3cc8dae6ea0c308611a881a19bc4d7a5205d7043..3f3df9c1247c802033a619fc06b435a6ce564d67 100644 (file)
@@ -42,7 +42,7 @@ define Package/stubby
        SUBMENU:=IP Addresses and Names
        TITLE+= - (daemon that uses getdns)
        USERID:=stubby=410:stubby=410
-       DEPENDS:= +libyaml +getdns
+       DEPENDS:= +libyaml +getdns +ca-certificates
 endef
 
 define Package/stubby/install
index bf013c7153d44791ffa9bafae4c3b43d609e2d47..35ce8585f8613e7d338c4adb91400ebbeb2d9892 100644 (file)
@@ -18,7 +18,9 @@ PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL
 PKG_SOURCE_URL:= \
        http://ftp.nluug.nl/pub/networking/stunnel/ \
        http://www.usenix.org.uk/mirrors/stunnel/ \
-       https://www.stunnel.org/downloads/
+       https://www.stunnel.org/downloads/ \
+       https://www.usenix.org.uk/mirrors/stunnel/archive/$(word 1, $(subst .,$(space),$(PKG_VERSION))).x/
+
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_HASH:=1011d5a302ce6a227882d094282993a3187250f42f8a801dcc1620da63b2b8df
 
index 61fb12d893afdc31a4b98f232ec63583043ff588..4afdd0d2e5faf97c5f08aace149219c79bec0398 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tor
-PKG_VERSION:=0.3.3.9
+PKG_VERSION:=0.3.4.8
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dist.torproject.org/ \
        https://archive.torproject.org/tor-package-archive
-PKG_HASH:=85346b4d026e6a041c8e326d2cc64b5f5361b032075c89c5854f16dbc02fce6f
+PKG_HASH:=826a4cb2c099a29c7cf91516ffffcfcb5aace7533b8853a8c8bddcfe2bfb1023
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
                Peter Wagner <tripolar@gmx.at>
 PKG_LICENSE_FILES:=LICENSE
index 718efe95c440a494da8bf8891cba1deb65b8de80..f20b94aed14175df569ed2f1807ce8cfefdcc4ee 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
-PKG_VERSION:=1.2.2
+PKG_VERSION:=1.2.3
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 4fd64ede1981bb19dddca1a3f0074b4f8f6001b1..063f33e32b3cac102cae43093dee29233f03cb90 100644 (file)
@@ -20,7 +20,7 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
 * optional: the LuCI frontend shows the WiFi QR codes from all configured Access Points. It allows you to connect your Android or iOS devices to your router’s WiFi using the QR code
 
 ## Prerequisites
-* [OpenWrt](https://openwrt.org), tested with the stable release series (17.01.x) and with the latest OpenWrt snapshot
+* [OpenWrt](https://openwrt.org), tested with the stable release series (18.06.x) and with the latest OpenWrt snapshot
 * iwinfo for wlan scanning, uclient-fetch for captive portal detection
 * optional: qrencode 4.x for QR code support
 
@@ -57,12 +57,12 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
 ~# /etc/init.d/travelmate status
 ::: travelmate runtime information
   + travelmate_status  : connected (net ok/78)
-  + travelmate_version : 1.2.1
+  + travelmate_version : 1.2.3
   + station_id         : radio1/blackhole/01:02:03:04:05:06
   + station_interface  : trm_wwan
   + faulty_stations    : 
-  + last_rundate       : 28.07.2018 21:17:45
-  + system             : TP-LINK RE450, OpenWrt SNAPSHOT r7540+5-20c4819c7b
+  + last_rundate       : 07.09.2018 17:22:37
+  + system             : TP-LINK RE450, OpenWrt SNAPSHOT r8018-42f158314e
 </code></pre>
 
 ## Manual Setup
@@ -127,6 +127,8 @@ edit /etc/config/travelmate and set 'trm_enabled' to '1'
 **A:** Travelmate tries n times (default 3) to connect, then the respective uplink will be marked as "faulty" in the JSON runtime file and hereafter ignored. To reset the JSON runtime file, simply restart travelmate.  
 **Q:** How to connect to hidden uplinks?  
 **A:** See 'example\_hidden' STA configuration above, option 'SSID' and 'BSSID' must be specified for successful connections.  
+**Q:** Any recommendations regarding suitable DNS settings to easily connect to captive portals?  
+**A:** Use a simple DNS forwarder like dnsmasq and disable the option 'rebind_protection'.  
 
 ## Support
 Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)  
index d757e6b1c32b196cd950d8bc781ff9293fd26665..18d3d0089c54a066e10bf250d84f458211547b73 100755 (executable)
@@ -12,62 +12,61 @@ trm_pidfile="/var/run/travelmate.pid"
 
 boot()
 {
-    ubus -t 30 wait_for network.interface network.wireless 2>/dev/null
-    rc_procd start_service
+       ubus -t 30 wait_for network.interface network.wireless 2>/dev/null
+       rc_procd start_service
 }
 
 start_service()
 {
-    if [ $("${trm_init}" enabled; printf "%u" ${?}) -eq 0 ]
-    then
-        procd_open_instance "travelmate"
-        procd_set_param command "${trm_script}" "${@}"
-        procd_set_param pidfile "${trm_pidfile}"
-        procd_set_param stdout 1
-        procd_set_param stderr 1
-        procd_close_instance
-    fi
+       if [ $("${trm_init}" enabled; printf "%u" ${?}) -eq 0 ]
+       then
+               procd_open_instance "travelmate"
+               procd_set_param command "${trm_script}" "${@}"
+               procd_set_param pidfile "${trm_pidfile}"
+               procd_set_param stdout 1
+               procd_set_param stderr 1
+               procd_close_instance
+       fi
 }
 
 reload_service()
 {
-    [ -s "${trm_pidfile}" ] && return 1
-    rc_procd start_service
+       [ -s "${trm_pidfile}" ] && return 1
+       rc_procd start_service
 }
 
 stop_service()
 {
-    rc_procd "${trm_script}" stop
-    rc_procd start_service
+       rc_procd "${trm_script}" stop
 }
 
 status()
 {
-    local key keylist value rtfile="$(uci_get travelmate global trm_rtfile)"
+       local key keylist value rtfile="$(uci_get travelmate global trm_rtfile)"
 
-    rtfile="${rtfile:-"/tmp/trm_runtime.json"}"
-    if [ -s "${rtfile}" ]
-    then
-        printf "%s\n" "::: travelmate runtime information"
-        json_load "$(cat "${rtfile}" 2>/dev/null)"
-        json_select data
-        json_get_keys keylist
-        for key in ${keylist}
-        do
-            json_get_var value "${key}"
-            printf "  + %-18s : %s\n" "${key}" "${value}"
-        done
-    else
-        printf "%s\n" "::: no travelmate runtime information available"
-    fi
+       rtfile="${rtfile:-"/tmp/trm_runtime.json"}"
+       json_load_file "${rtfile}" >/dev/null 2>&1
+       json_select data >/dev/null 2>&1
+       if [ ${?} -eq 0 ]
+       then
+               printf "%s\n" "::: travelmate runtime information"
+               json_get_keys keylist
+               for key in ${keylist}
+               do
+                       json_get_var value "${key}"
+                       printf "  + %-18s : %s\n" "${key}" "${value}"
+               done
+       else
+               printf "%s\n" "::: no travelmate runtime information available"
+       fi
 }
 
 service_triggers()
 {
-    local trigger="$(uci_get travelmate global trm_iface)"
-    local delay="$(uci_get travelmate global trm_triggerdelay)"
+       local trigger="$(uci_get travelmate global trm_iface)"
+       local delay="$(uci_get travelmate global trm_triggerdelay)"
 
-    PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
-    procd_add_interface_trigger "interface.*.down" "${trigger}" "${trm_init}" reload
-    procd_add_reload_trigger "travelmate"
+       PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
+       procd_add_interface_trigger "interface.*.down" "${trigger}" "${trm_init}" reload
+       procd_add_reload_trigger "travelmate"
 }
index f4a047bf9e907faaee8e15a9f1e1af1b1df0a222..6d1c266de959401a010e9cf09897bbd8fc5ab84a 100755 (executable)
@@ -10,7 +10,7 @@
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_ver="1.2.2"
+trm_ver="1.2.3"
 trm_sysver="unknown"
 trm_enabled=0
 trm_debug=0
@@ -33,396 +33,385 @@ trm_pidfile="/var/run/travelmate.pid"
 #
 f_envload()
 {
-    local sys_call sys_desc sys_model sys_ver
+       local sys_call sys_desc sys_model sys_ver
 
-    # get system information
-    #
-    sys_call="$(ubus -S call system board 2>/dev/null)"
-    if [ -n "${sys_call}" ]
-    then
-        sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
-        sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
-        sys_ver="$(cat /etc/turris-version 2>/dev/null)"
-        if [ -n "${sys_ver}" ]
-        then
-            sys_desc="${sys_desc}/${sys_ver}"
-        fi
-        trm_sysver="${sys_model}, ${sys_desc}"
-    fi
+       # get system information
+       #
+       sys_call="$(ubus -S call system board 2>/dev/null)"
+       if [ -n "${sys_call}" ]
+       then
+               sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
+               sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
+               sys_ver="$(cat /etc/turris-version 2>/dev/null)"
+               if [ -n "${sys_ver}" ]
+               then
+                       sys_desc="${sys_desc}/${sys_ver}"
+               fi
+               trm_sysver="${sys_model}, ${sys_desc}"
+       fi
 
-    # (re-)initialize global list variables
-    #
-    unset trm_devlist trm_stalist trm_radiolist
+       # (re-)initialize global list variables
+       #
+       unset trm_devlist trm_stalist trm_radiolist
 
-    # load config and check 'enabled' option
-    #
-    option_cb()
-    {
-        local option="${1}"
-        local value="${2}"
-        eval "${option}=\"${value}\""
-    }
-    config_load travelmate
+       # load config and check 'enabled' option
+       #
+       option_cb()
+       {
+               local option="${1}"
+               local value="${2}"
+               eval "${option}=\"${value}\""
+       }
+       config_load travelmate
 
-    if [ ${trm_enabled} -ne 1 ]
-    then
-        f_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
-        exit 0
-    fi
+       if [ ${trm_enabled} -ne 1 ]
+       then
+               f_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
+               exit 0
+       fi
 
-    # validate input ranges
-    #
-    if [ ${trm_minquality} -lt 20 ] || [ ${trm_minquality} -gt 80 ]
-    then
-        trm_minquality=35
-    fi
-    if [ ${trm_maxretry} -lt 1 ] || [ ${trm_maxretry} -gt 10 ]
-    then
-        trm_maxretry=3
-    fi
-    if [ ${trm_maxwait} -lt 20 ] || [ ${trm_maxwait} -gt 40 ] || [ ${trm_maxwait} -ge ${trm_timeout} ]
-    then
-        trm_maxwait=30
-    fi
-    if [ ${trm_timeout} -lt 30 ] || [ ${trm_timeout} -gt 300 ] || [ ${trm_timeout} -le ${trm_maxwait} ]
-    then
-        trm_timeout=60
-    fi
+       # validate input ranges
+       #
+       if [ ${trm_minquality} -lt 20 ] || [ ${trm_minquality} -gt 80 ]
+       then
+               trm_minquality=35
+       fi
+       if [ ${trm_maxretry} -lt 1 ] || [ ${trm_maxretry} -gt 10 ]
+       then
+               trm_maxretry=3
+       fi
+       if [ ${trm_maxwait} -lt 20 ] || [ ${trm_maxwait} -gt 40 ] || [ ${trm_maxwait} -ge ${trm_timeout} ]
+       then
+               trm_maxwait=30
+       fi
+       if [ ${trm_timeout} -lt 30 ] || [ ${trm_timeout} -gt 300 ] || [ ${trm_timeout} -le ${trm_maxwait} ]
+       then
+               trm_timeout=60
+       fi
 }
 
 # gather radio information & bring down all STA interfaces
 #
 f_prep()
 {
-    local eap_rc=0 config="${1}"
-    local mode="$(uci_get wireless "${config}" mode)"
-    local network="$(uci_get wireless "${config}" network)"
-    local radio="$(uci_get wireless "${config}" device)"
-    local disabled="$(uci_get wireless "${config}" disabled)"
-    local eaptype="$(uci_get wireless "${config}" eap_type)"
+       local eap_rc=0 config="${1}"
+       local mode="$(uci_get wireless "${config}" mode)"
+       local network="$(uci_get wireless "${config}" network)"
+       local radio="$(uci_get wireless "${config}" device)"
+       local disabled="$(uci_get wireless "${config}" disabled)"
+       local eaptype="$(uci_get wireless "${config}" eap_type)"
 
-    if ([ -z "${trm_radio}" ] || [ "${trm_radio}" = "${radio}" ]) && \
-        [ -z "$(printf "%s" "${trm_radiolist}" | grep -Fo " ${radio}")" ]
-    then
-        trm_radiolist="${trm_radiolist} ${radio}"
-    fi
-    if [ "${mode}" = "sta" ] && [ "${network}" = "${trm_iface}" ]
-    then
-        if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
-        then
-            uci_set wireless "${config}" disabled 1
-        fi
-        if [ -n "${eaptype}" ]
-        then
-            eap_rc="$("${trm_wpa}" -veap >/dev/null 2>&1; printf "%u" ${?})"
-        fi
-        if [ -z "${eaptype}" ] || [ ${eap_rc} -eq 0 ]
-        then
-            trm_stalist="${trm_stalist} ${config}_${radio}"
-        fi
-    fi
-    f_log "debug" "f_prep ::: config: ${config}, mode: ${mode}, network: ${network}, eap_rc: ${eap_rc}, radio: ${radio}, trm_radio: ${trm_radio:-"-"}, disabled: ${disabled}"
+       if ([ -z "${trm_radio}" ] || [ "${trm_radio}" = "${radio}" ]) && \
+               [ -z "$(printf "%s" "${trm_radiolist}" | grep -Fo " ${radio}")" ]
+       then
+               trm_radiolist="${trm_radiolist} ${radio}"
+       fi
+       if [ "${mode}" = "sta" ] && [ "${network}" = "${trm_iface}" ]
+       then
+               if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
+               then
+                       uci_set wireless "${config}" disabled 1
+               fi
+               if [ -n "${eaptype}" ]
+               then
+                       eap_rc="$("${trm_wpa}" -veap >/dev/null 2>&1; printf "%u" ${?})"
+               fi
+               if [ -z "${eaptype}" ] || [ ${eap_rc} -eq 0 ]
+               then
+                       trm_stalist="${trm_stalist} ${config}_${radio}"
+               fi
+       fi
+       f_log "debug" "f_prep ::: config: ${config}, mode: ${mode}, network: ${network}, eap_rc: ${eap_rc}, radio: ${radio}, trm_radio: ${trm_radio:-"-"}, disabled: ${disabled}"
 }
 
 # check interface status
 #
 f_check()
 {
-    local IFS ifname radio dev_status config sta_essid sta_bssid result wait=1 mode="${1}" status="${2:-"false"}"
+       local IFS ifname radio dev_status config sta_essid sta_bssid result wait=1 mode="${1}" status="${2:-"false"}"
 
-    trm_ifquality=0
-    trm_ifstatus="false"
-    if [ "${mode}" != "initial" ]
-    then
-        ubus call network reload
-    fi
-    while [ ${wait} -le ${trm_maxwait} ]
-    do
-        dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
-        if [ -n "${dev_status}" ]
-        then
-            if [ "${mode}" = "dev" ]
-            then
-                if [ "${trm_ifstatus}" != "${status}" ]
-                then
-                    trm_ifstatus="${status}"
-                    f_jsnup
-                fi
-                for radio in ${trm_radiolist}
-                do
-                    result="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e "@.${radio}.up")"
-                    if [ "${result}" = "true" ] && [ -z "$(printf "%s" "${trm_devlist}" | grep -Fo " ${radio}")" ]
-                    then
-                        trm_devlist="${trm_devlist} ${radio}"
-                    fi
-                done
-                if [ "${trm_devlist}" = "${trm_radiolist}" ] || [ ${wait} -eq ${trm_maxwait} ]
-                then
-                    ifname="${trm_devlist}"
-                    break
-                else
-                    unset trm_devlist
-                fi
-            elif [ "${mode}" = "rev" ]
-            then
-                wait=$(( ${trm_maxwait} / 3 ))
-                sleep ${wait}
-                break
-            else
-                ifname="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
-                if [ -n "${ifname}" ]
-                then
-                    trm_ifquality="$(${trm_iwinfo} ${ifname} info 2>/dev/null | awk -F "[\/| ]" '/Link Quality:/{printf "%i\n", (100 / $NF * $(NF-1)) }')"
-                    if [ ${trm_ifquality} -ge ${trm_minquality} ]
-                    then
-                        trm_ifstatus="$(ubus -S call network.interface dump 2>/dev/null | jsonfilter -l1 -e "@.interface[@.device=\"${ifname}\"].up")"
-                    elif [ "${mode}" = "initial" ] && [ ${trm_ifquality} -lt ${trm_minquality} ]
-                    then
-                        trm_ifstatus="${status}"
-                        sta_essid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.ssid')"
-                        sta_bssid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.bssid')"
-                        f_log "info" "uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}' is out of range (${trm_ifquality}/${trm_minquality}), uplink disconnected (${trm_sysver})"
-                    fi
-                fi
-            fi
-            if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
-            then
-                if ([ "${trm_ifstatus}" != "true" ] && [ "${trm_ifstatus}" != "${status}" ]) || [ ${trm_ifquality} -lt ${trm_minquality} ]
-                then
-                    f_jsnup
-                fi
-                if [ "${mode}" = "initial" ] && [ "${trm_captive}" -eq 1 ] && [ "${trm_ifstatus}" = "true" ]
-                then
-                    result="$(${trm_fetch} --timeout=$(( ${trm_maxwait} / 3 )) --spider "${trm_captiveurl}" 2>&1 | awk '/^Redirected/{printf "%s" "net cp \047"$NF"\047";exit}/^Download completed/{printf "%s" "net ok";exit}/^Failed|^Connection error/{printf "%s" "net nok";exit}')"
-                    if [ -n "${result}" ] && ([ -z "${trm_connection}" ] || [ "${result}" != "${trm_connection%/*}" ])
-                    then
-                        trm_connection="${result}/${trm_ifquality}"
-                        f_jsnup
-                    fi
-                fi
-                break
-            fi
-        fi
-        wait=$(( wait + 1 ))
-        sleep 1
-    done
-    f_log "debug" "f_check::: mode: ${mode}, name: ${ifname:-"-"}, status: ${trm_ifstatus}, quality: ${trm_ifquality}, connection: ${trm_connection:-"-"}, wait: ${wait}, max_wait: ${trm_maxwait}, min_quality: ${trm_minquality}, captive: ${trm_captive}"
+       trm_ifquality=0
+       trm_ifstatus="false"
+       if [ "${mode}" != "initial" ]
+       then
+               ubus call network reload
+       fi
+       while [ ${wait} -le ${trm_maxwait} ]
+       do
+               dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
+               if [ -n "${dev_status}" ]
+               then
+                       if [ "${mode}" = "dev" ]
+                       then
+                               if [ "${trm_ifstatus}" != "${status}" ]
+                               then
+                                       trm_ifstatus="${status}"
+                                       f_jsnup
+                               fi
+                               for radio in ${trm_radiolist}
+                               do
+                                       result="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e "@.${radio}.up")"
+                                       if [ "${result}" = "true" ] && [ -z "$(printf "%s" "${trm_devlist}" | grep -Fo " ${radio}")" ]
+                                       then
+                                               trm_devlist="${trm_devlist} ${radio}"
+                                       fi
+                               done
+                               if [ "${trm_devlist}" = "${trm_radiolist}" ] || [ ${wait} -eq ${trm_maxwait} ]
+                               then
+                                       ifname="${trm_devlist}"
+                                       break
+                               else
+                                       unset trm_devlist
+                               fi
+                       elif [ "${mode}" = "rev" ]
+                       then
+                               wait=$(( ${trm_maxwait} / 3 ))
+                               sleep ${wait}
+                               break
+                       else
+                               ifname="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].ifname')"
+                               if [ -n "${ifname}" ]
+                               then
+                                       trm_ifquality="$(${trm_iwinfo} ${ifname} info 2>/dev/null | awk -F "[\/| ]" '/Link Quality:/{printf "%i\n", (100 / $NF * $(NF-1)) }')"
+                                       if [ ${trm_ifquality} -ge ${trm_minquality} ]
+                                       then
+                                               trm_ifstatus="$(ubus -S call network.interface dump 2>/dev/null | jsonfilter -l1 -e "@.interface[@.device=\"${ifname}\"].up")"
+                                       elif [ "${mode}" = "initial" ] && [ ${trm_ifquality} -lt ${trm_minquality} ]
+                                       then
+                                               trm_ifstatus="${status}"
+                                               sta_essid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.ssid')"
+                                               sta_bssid="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].*.bssid')"
+                                               f_log "info" "uplink '${sta_essid:-"-"}/${sta_bssid:-"-"}' is out of range (${trm_ifquality}/${trm_minquality}), uplink disconnected (${trm_sysver})"
+                                       fi
+                               fi
+                       fi
+                       if [ "${mode}" = "initial" ] || [ "${trm_ifstatus}" = "true" ]
+                       then
+                               if ([ "${trm_ifstatus}" != "true" ] && [ "${trm_ifstatus}" != "${status}" ]) || [ ${trm_ifquality} -lt ${trm_minquality} ]
+                               then
+                                       f_jsnup
+                               fi
+                               if [ "${mode}" = "initial" ] && [ "${trm_captive}" -eq 1 ] && [ "${trm_ifstatus}" = "true" ]
+                               then
+                                       result="$(${trm_fetch} --timeout=$(( ${trm_maxwait} / 3 )) --spider "${trm_captiveurl}" 2>&1 | awk '/^Redirected/{printf "%s" "net cp \047"$NF"\047";exit}/^Download completed/{printf "%s" "net ok";exit}/^Failed|^Connection error/{printf "%s" "net nok";exit}')"
+                                       if [ -n "${result}" ] && ([ -z "${trm_connection}" ] || [ "${result}" != "${trm_connection%/*}" ])
+                                       then
+                                               trm_connection="${result}/${trm_ifquality}"
+                                               f_jsnup
+                                       fi
+                               fi
+                               break
+                       fi
+               fi
+               wait=$(( wait + 1 ))
+               sleep 1
+       done
+       f_log "debug" "f_check::: mode: ${mode}, name: ${ifname:-"-"}, status: ${trm_ifstatus}, quality: ${trm_ifquality}, connection: ${trm_connection:-"-"}, wait: ${wait}, max_wait: ${trm_maxwait}, min_quality: ${trm_minquality}, captive: ${trm_captive}"
 }
 
 # update runtime information
 #
 f_jsnup()
 {
-    local config sta_iface sta_radio sta_essid sta_bssid dev_status status="${trm_ifstatus}" faulty_list faulty_station="${1}"
+       local config sta_iface sta_radio sta_essid sta_bssid dev_status status="${trm_ifstatus}" faulty_list faulty_station="${1}"
 
-    if [ "${status}" = "true" ]
-    then
-        status="connected (${trm_connection:-"-"})"
-    else
-        unset trm_connection
-        if [ "${status}" = "false" ]
-        then
-            status="not connected"
-        fi
-    fi
+       if [ "${status}" = "true" ]
+       then
+               status="connected (${trm_connection:-"-"})"
+       else
+               unset trm_connection
+               status="running / not connected"
+       fi
 
-    dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
-    if [ -n "${dev_status}" ]
-    then
-        config="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].section')"
-        if [ -n "${config}" ]
-        then
-            sta_iface="$(uci_get wireless "${config}" network)"
-            sta_radio="$(uci_get wireless "${config}" device)"
-            sta_essid="$(uci_get wireless "${config}" ssid)"
-            sta_bssid="$(uci_get wireless "${config}" bssid)"
-        fi
-    fi
+       dev_status="$(ubus -S call network.wireless status 2>/dev/null)"
+       if [ -n "${dev_status}" ]
+       then
+               config="$(printf "%s" "${dev_status}" | jsonfilter -l1 -e '@.*.interfaces[@.config.mode="sta"].section')"
+               if [ -n "${config}" ]
+               then
+                       sta_iface="$(uci_get wireless "${config}" network)"
+                       sta_radio="$(uci_get wireless "${config}" device)"
+                       sta_essid="$(uci_get wireless "${config}" ssid)"
+                       sta_bssid="$(uci_get wireless "${config}" bssid)"
+               fi
+       fi
 
-    json_get_var faulty_list "faulty_stations"
-    if [ -n "${faulty_station}" ]
-    then
-        if [ -z "$(printf "%s" "${faulty_list}" | grep -Fo "${faulty_station}")" ]
-        then
-            faulty_list="${faulty_list} ${faulty_station}"
-        fi
-    fi
-    json_add_string "travelmate_status" "${status}"
-    json_add_string "travelmate_version" "${trm_ver}"
-    json_add_string "station_id" "${sta_radio:-"-"}/${sta_essid:-"-"}/${sta_bssid:-"-"}"
-    json_add_string "station_interface" "${sta_iface:-"-"}"
-    json_add_string "faulty_stations" "${faulty_list}"
-    json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
-    json_add_string "system" "${trm_sysver}"
-    json_dump > "${trm_rtfile}"
-    f_log "debug" "f_jsnup::: config: ${config:-"-"}, status: ${status:-"-"}, sta_iface: ${sta_iface:-"-"}, sta_radio: ${sta_radio:-"-"}, sta_essid: ${sta_essid:-"-"}, sta_bssid: ${sta_bssid:-"-"}, faulty_list: ${faulty_list:-"-"}"
+       json_get_var faulty_list "faulty_stations"
+       if [ -n "${faulty_station}" ]
+       then
+               if [ -z "$(printf "%s" "${faulty_list}" | grep -Fo "${faulty_station}")" ]
+               then
+                       faulty_list="${faulty_list} ${faulty_station}"
+               fi
+       fi
+       json_add_string "travelmate_status" "${status}"
+       json_add_string "travelmate_version" "${trm_ver}"
+       json_add_string "station_id" "${sta_radio:-"-"}/${sta_essid:-"-"}/${sta_bssid:-"-"}"
+       json_add_string "station_interface" "${sta_iface:-"-"}"
+       json_add_string "faulty_stations" "${faulty_list}"
+       json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+       json_add_string "system" "${trm_sysver}"
+       json_dump > "${trm_rtfile}"
+       f_log "debug" "f_jsnup::: config: ${config:-"-"}, status: ${status:-"-"}, sta_iface: ${sta_iface:-"-"}, sta_radio: ${sta_radio:-"-"}, sta_essid: ${sta_essid:-"-"}, sta_bssid: ${sta_bssid:-"-"}, faulty_list: ${faulty_list:-"-"}"
 }
 
 # write to syslog
 #
 f_log()
 {
-    local class="${1}"
-    local log_msg="${2}"
+       local class="${1}"
+       local log_msg="${2}"
 
-    if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${trm_debug} -eq 1 ])
-    then
-        logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "${log_msg}"
-        if [ "${class}" = "err" ]
-        then
-            trm_ifstatus="error"
-            f_jsnup
-            logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "Please check 'https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md' (${trm_sysver})"
-            exit 1
-        fi
-    fi
+       if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || [ ${trm_debug} -eq 1 ])
+       then
+               logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "${log_msg}"
+               if [ "${class}" = "err" ]
+               then
+                       trm_ifstatus="error"
+                       f_jsnup
+                       logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "Please check 'https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md' (${trm_sysver})"
+                       exit 1
+               fi
+       fi
 }
 
 # main function for connection handling
 #
 f_main()
 {
-    local IFS cnt dev config scan scan_list scan_essid scan_bssid scan_quality sta sta_essid sta_bssid sta_radio sta_iface faulty_list
+       local IFS cnt dev config scan scan_list scan_essid scan_bssid scan_quality sta sta_essid sta_bssid sta_radio sta_iface faulty_list
 
-    f_check "initial"
-    if [ "${trm_ifstatus}" != "true" ]
-    then
-        config_load wireless
-        config_foreach f_prep wifi-iface
-        uci_commit wireless
-        f_check "dev" "running"
-        json_get_var faulty_list "faulty_stations"
-        f_log "debug" "f_main ::: iwinfo: ${trm_iwinfo}, dev_list: ${trm_devlist}, sta_list: ${trm_stalist:0:800}, faulty_list: ${faulty_list:-"-"}"
-        for dev in ${trm_devlist}
-        do
-            if [ -z "$(printf "%s" "${trm_stalist}" | grep -Fo "_${dev}")" ]
-            then
-                continue
-            fi
-            cnt=1
-            while [ ${cnt} -le ${trm_maxretry} ]
-            do
-                scan_list="$(${trm_iwinfo} "${dev}" scan 2>/dev/null | awk 'BEGIN{FS="[/ ]"}/Address:/{var1=$NF}/ESSID:/{var2="";for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}/Quality:/{printf "%i,%s,%s\n",(100/$NF*$(NF-1)),var1,var2}' | sort -rn | awk '{ORS=",";print $0}')"
-                f_log "debug" "f_main ::: dev: ${dev}, scan_list: ${scan_list:0:800}, cnt: ${cnt}, max_cnt: ${trm_maxretry}"
-                if [ -n "${scan_list}" ]
-                then
-                    for sta in ${trm_stalist}
-                    do
-                        config="${sta%%_*}"
-                        sta_radio="${sta##*_}"
-                        sta_essid="$(uci_get wireless "${config}" ssid)"
-                        sta_bssid="$(uci_get wireless "${config}" bssid)"
-                        sta_iface="$(uci_get wireless "${config}" network)"
-                        json_get_var faulty_list "faulty_stations"
-                        if [ -n "$(printf "%s" "${faulty_list}" | grep -Fo "${sta_radio}/${sta_essid}/${sta_bssid}")" ]
-                        then
-                            continue
-                        fi
-                        IFS=","
-                        for scan in ${scan_list}
-                        do
-                            if [ -z "${scan_quality}" ]
-                            then
-                                scan_quality="${scan}"
-                            elif [ -z "${scan_bssid}" ]
-                            then
-                                scan_bssid="${scan}"
-                            elif [ -z "${scan_essid}" ]
-                            then
-                                scan_essid="${scan}"
-                            fi
-                            if [ -n "${scan_quality}" ] && [ -n "${scan_bssid}" ] && [ -n "${scan_essid}" ]
-                            then
-                                if [ ${scan_quality} -ge ${trm_minquality} ]
-                                then
-                                    if (([ "${scan_essid}" = "\"${sta_essid}\"" ] && ([ -z "${sta_bssid}" ] || [ "${scan_bssid}" = "${sta_bssid}" ])) || \
-                                        ([ "${scan_bssid}" = "${sta_bssid}" ] && [ "${scan_essid}" = "unknown" ])) && [ "${dev}" = "${sta_radio}" ]
-                                    then
-                                        f_log "debug" "f_main ::: scan_quality: ${scan_quality}, scan_bssid: ${scan_bssid}, scan_essid: ${scan_essid}"
-                                        uci_set wireless "${config}" disabled 0
-                                        f_check "sta"
-                                        if [ "${trm_ifstatus}" = "true" ]
-                                        then
-                                            uci_commit wireless
-                                            f_check "initial"
-                                            f_log "info" "connected to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}' (${trm_sysver})"
-                                            return 0
-                                        elif [ ${cnt} -eq ${trm_maxretry} ]
-                                        then
-                                            uci_set wireless "${config}" disabled 1
-                                            uci_commit wireless
-                                            faulty_station="${sta_radio}/${sta_essid}/${sta_bssid:-"-"}"
-                                            f_jsnup "${faulty_station}"
-                                            f_log "info" "can't connect to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}', uplink disabled (${trm_sysver})"
-                                            f_check "rev"
-                                            break
-                                        else
-                                            uci -q revert wireless
-                                            f_jsnup
-                                            f_log "info" "can't connect to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}' (${trm_sysver})"
-                                            f_check "rev"
-                                            break
-                                        fi
-                                    fi
-                                fi
-                                unset scan_quality scan_bssid scan_essid
-                            fi
-                        done
-                        unset IFS scan_quality scan_bssid scan_essid
-                    done
-                fi
-                cnt=$(( cnt + 1 ))
-                sleep $(( ${trm_maxwait} / 6 ))
-            done
-        done
-        if [ ! -s "${trm_rtfile}" ]
-        then
-            trm_ifstatus="false"
-            f_jsnup
-        fi
-    elif [ ! -s "${trm_rtfile}" ]
-    then
-        f_jsnup
-    fi
+       f_check "initial"
+       if [ "${trm_ifstatus}" != "true" ]
+       then
+               config_load wireless
+               config_foreach f_prep wifi-iface
+               uci_commit wireless
+               f_check "dev" "running / not connected"
+               json_get_var faulty_list "faulty_stations"
+               f_log "debug" "f_main ::: iwinfo: ${trm_iwinfo}, dev_list: ${trm_devlist}, sta_list: ${trm_stalist:0:800}, faulty_list: ${faulty_list:-"-"}"
+               for dev in ${trm_devlist}
+               do
+                       if [ -z "$(printf "%s" "${trm_stalist}" | grep -Fo "_${dev}")" ]
+                       then
+                               continue
+                       fi
+                       cnt=1
+                       while [ ${cnt} -le ${trm_maxretry} ]
+                       do
+                               scan_list="$(${trm_iwinfo} "${dev}" scan 2>/dev/null | awk 'BEGIN{FS="[/ ]"}/Address:/{var1=$NF}/ESSID:/{var2="";for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}/Quality:/{printf "%i,%s,%s\n",(100/$NF*$(NF-1)),var1,var2}' | sort -rn | awk '{ORS=",";print $0}')"
+                               f_log "debug" "f_main ::: dev: ${dev}, scan_list: ${scan_list:0:800}, cnt: ${cnt}, max_cnt: ${trm_maxretry}"
+                               if [ -n "${scan_list}" ]
+                               then
+                                       for sta in ${trm_stalist}
+                                       do
+                                               config="${sta%%_*}"
+                                               sta_radio="${sta##*_}"
+                                               sta_essid="$(uci_get wireless "${config}" ssid)"
+                                               sta_bssid="$(uci_get wireless "${config}" bssid)"
+                                               sta_iface="$(uci_get wireless "${config}" network)"
+                                               json_get_var faulty_list "faulty_stations"
+                                               if [ -n "$(printf "%s" "${faulty_list}" | grep -Fo "${sta_radio}/${sta_essid}/${sta_bssid}")" ]
+                                               then
+                                                       continue
+                                               fi
+                                               IFS=","
+                                               for scan in ${scan_list}
+                                               do
+                                                       if [ -z "${scan_quality}" ]
+                                                       then
+                                                               scan_quality="${scan}"
+                                                       elif [ -z "${scan_bssid}" ]
+                                                       then
+                                                               scan_bssid="${scan}"
+                                                       elif [ -z "${scan_essid}" ]
+                                                       then
+                                                               scan_essid="${scan}"
+                                                       fi
+                                                       if [ -n "${scan_quality}" ] && [ -n "${scan_bssid}" ] && [ -n "${scan_essid}" ]
+                                                       then
+                                                               if [ ${scan_quality} -ge ${trm_minquality} ]
+                                                               then
+                                                                       if (([ "${scan_essid}" = "\"${sta_essid}\"" ] && ([ -z "${sta_bssid}" ] || [ "${scan_bssid}" = "${sta_bssid}" ])) || \
+                                                                               ([ "${scan_bssid}" = "${sta_bssid}" ] && [ "${scan_essid}" = "unknown" ])) && [ "${dev}" = "${sta_radio}" ]
+                                                                       then
+                                                                               f_log "debug" "f_main ::: scan_quality: ${scan_quality}, scan_bssid: ${scan_bssid}, scan_essid: ${scan_essid}"
+                                                                               uci_set wireless "${config}" disabled 0
+                                                                               f_check "sta"
+                                                                               if [ "${trm_ifstatus}" = "true" ]
+                                                                               then
+                                                                                       uci_commit wireless
+                                                                                       f_check "initial"
+                                                                                       f_log "info" "connected to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}' (${trm_sysver})"
+                                                                                       return 0
+                                                                               elif [ ${cnt} -eq ${trm_maxretry} ]
+                                                                               then
+                                                                                       uci_set wireless "${config}" disabled 1
+                                                                                       uci_commit wireless
+                                                                                       faulty_station="${sta_radio}/${sta_essid}/${sta_bssid:-"-"}"
+                                                                                       f_jsnup "${faulty_station}"
+                                                                                       f_log "info" "can't connect to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}', uplink disabled (${trm_sysver})"
+                                                                                       f_check "rev"
+                                                                                       break
+                                                                               else
+                                                                                       uci -q revert wireless
+                                                                                       f_jsnup
+                                                                                       f_log "info" "can't connect to uplink '${sta_radio}/${sta_essid}/${sta_bssid:-"-"}' (${trm_sysver})"
+                                                                                       f_check "rev"
+                                                                                       break
+                                                                               fi
+                                                                       fi
+                                                               fi
+                                                               unset scan_quality scan_bssid scan_essid
+                                                       fi
+                                               done
+                                               unset IFS scan_quality scan_bssid scan_essid
+                                       done
+                               fi
+                               cnt=$(( cnt + 1 ))
+                               sleep $(( ${trm_maxwait} / 6 ))
+                       done
+               done
+       fi
 }
 
 # source required system libraries
 #
 if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
 then
-    . "/lib/functions.sh"
-    . "/usr/share/libubox/jshn.sh"
+       . "/lib/functions.sh"
+       . "/usr/share/libubox/jshn.sh"
 else
-    f_log "err" "system libraries not found"
+       f_log "err" "system libraries not found"
 fi
 
 # initialize json runtime file
 #
-if [ ! -s "${trm_rtfile}" ]
+json_load_file "${trm_rtfile}" >/dev/null 2>&1
+json_select data >/dev/null 2>&1
+if [ ${?} -ne 0 ]
 then
-    json_init
-    json_add_object "data"
-else
-    json_load_file "${trm_rtfile}"
-    json_select data
+       > "${trm_rtfile}"
+       json_init
+       json_add_object "data"
 fi
 
 # control travelmate actions
 #
 while true
 do
-    if [ -z "${trm_action}" ]
-    then
-        sleep ${trm_timeout}
-    elif [ "${trm_action}" = "stop" ]
-    then
-        > "${trm_rtfile}"
-        f_log "info" "travelmate instance stopped ::: action: ${trm_action}, pid: $(cat ${trm_pidfile} 2>/dev/null)"
-        exit 0
-    else
-        f_log "info" "travelmate instance started ::: action: ${trm_action}, pid: ${$}"
-        unset trm_action
-    fi
-    f_envload
-    f_main
+       if [ -z "${trm_action}" ]
+       then
+               sleep ${trm_timeout}
+       elif [ "${trm_action}" = "stop" ]
+       then
+               > "${trm_rtfile}"
+               f_log "info" "travelmate instance stopped ::: action: ${trm_action}, pid: $(cat ${trm_pidfile} 2>/dev/null)"
+               exit 0
+       else
+               f_log "info" "travelmate instance started ::: action: ${trm_action}, pid: ${$}"
+               unset trm_action
+       fi
+       f_envload
+       f_main
 done
index 3700c24d1d07d337e3959a6f0a04e90fa569828c..354cf59a7c525ffd5f76db62f8cc4aa02d9158a1 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
-PKG_VERSION:=1.7.3
-PKG_RELEASE:=6
+PKG_VERSION:=1.8.0
+PKG_RELEASE:=1
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -17,7 +17,7 @@ PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_HASH:=c11de115d928a6b48b2165e0214402a7a7da313cd479203a7ce7a8b62cba602d
+PKG_HASH:=78f79d6d3b643fdcd74a14fc76542250da886c82f82bc55b51e189663d61b83f
 
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
index 812d9a60764ccbd83261d60100a78d2cac3d9826..6576b2c85e25521695538cb782bf098286ef74c5 100644 (file)
@@ -273,8 +273,9 @@ config unbound
 
   option protocol 'mixed'
     Unbound can limit its protocol used for recursive queries.
-    ip4_only - limit issues if you do not have native IPv6
+    ip4_only - old fashioned IPv4 upstream and downstream
     ip6_only - test environment only; could cauase problems
+    ip6_local - upstream IPv4 only and local network IPv4 and IPv6
     ip6_prefer - both IPv4 and IPv6 but try IPv6 first
     mixed - both IPv4 and IPv6
     default - Unbound built-in defaults
index 0613312209309f54c9c1fb3c2626a3c150e826db..68b3c92b4b67e20b8d985c25f560426350611ff9 100644 (file)
@@ -619,7 +619,6 @@ unbound_conf() {
         echo "  port: $UB_N_RX_PORT"
         echo "  outgoing-port-permit: 10240-65535"
         echo "  interface: 0.0.0.0"
-        echo "  interface: ::0"
         echo "  outgoing-interface: 0.0.0.0"
         echo "  do-ip4: yes"
         echo "  do-ip6: no"
@@ -632,7 +631,6 @@ unbound_conf() {
         echo "  edns-buffer-size: $UB_N_EDNS_SIZE"
         echo "  port: $UB_N_RX_PORT"
         echo "  outgoing-port-permit: 10240-65535"
-        echo "  interface: 0.0.0.0"
         echo "  interface: ::0"
         echo "  outgoing-interface: ::0"
         echo "  do-ip4: no"
@@ -641,6 +639,20 @@ unbound_conf() {
       } >> $UB_CORE_CONF
       ;;
 
+   ip6_local)
+      {
+        echo "  edns-buffer-size: $UB_N_EDNS_SIZE"
+        echo "  port: $UB_N_RX_PORT"
+        echo "  outgoing-port-permit: 10240-65535"
+        echo "  interface: 0.0.0.0"
+        echo "  interface: ::0"
+        echo "  outgoing-interface: 0.0.0.0"
+        echo "  do-ip4: yes"
+        echo "  do-ip6: yes"
+        echo
+      } >> $UB_CORE_CONF
+      ;;
+
     ip6_prefer)
       {
         echo "  edns-buffer-size: $UB_N_EDNS_SIZE"
@@ -692,27 +704,15 @@ unbound_conf() {
   esac
 
 
-  {
-    # Other harding and options for an embedded router
-    echo "  harden-short-bufsize: yes"
-    echo "  harden-large-queries: yes"
-    echo "  harden-glue: yes"
-    echo "  harden-below-nxdomain: no"
-    echo "  harden-referral-path: no"
-    echo "  use-caps-for-id: no"
-    echo
-  } >> $UB_CORE_CONF
-
-
   case "$UB_D_RESOURCE" in
     # Tiny - Unbound's recommended cheap hardware config
     tiny)   rt_mem=1  ; rt_conn=2  ; rt_buff=1 ;;
     # Small - Half RRCACHE and open ports
     small)  rt_mem=8  ; rt_conn=10 ; rt_buff=2 ;;
     # Medium - Nearly default but with some added balancintg
-    medium) rt_mem=16 ; rt_conn=20 ; rt_buff=4 ;;
+    medium) rt_mem=16 ; rt_conn=15 ; rt_buff=4 ;;
     # Large - Double medium
-    large)  rt_mem=32 ; rt_conn=40 ; rt_buff=4 ;;
+    large)  rt_mem=32 ; rt_conn=20 ; rt_buff=4 ;;
     # Whatever unbound does
     *) rt_mem=0 ; rt_conn=0 ;;
   esac
@@ -720,10 +720,16 @@ unbound_conf() {
 
   if [ "$rt_mem" -gt 0 ] ; then
     {
+      # Other harding and options for an embedded router
+      echo "  harden-short-bufsize: yes"
+      echo "  harden-large-queries: yes"
+      echo "  harden-glue: yes"
+      echo "  use-caps-for-id: no"
+      echo
       # Set memory sizing parameters
       echo "  msg-buffer-size: $(($rt_buff*8192))"
-      echo "  outgoing-range: $(($rt_conn*64))"
-      echo "  num-queries-per-thread: $(($rt_conn*32))"
+      echo "  outgoing-range: $(($rt_conn*32))"
+      echo "  num-queries-per-thread: $(($rt_conn*16))"
       echo "  outgoing-num-tcp: $(($rt_conn))"
       echo "  incoming-num-tcp: $(($rt_conn))"
       echo "  rrset-cache-size: $(($rt_mem*256))k"
diff --git a/net/unbound/patches/200-openssl-log-err.patch b/net/unbound/patches/200-openssl-log-err.patch
deleted file mode 100644 (file)
index b1ddd5d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-Index: daemon/remote.c
-===================================================================
---- a/daemon/remote.c
-+++ b/daemon/remote.c
-@@ -1950,6 +1950,11 @@
-                               return NULL;
-                       }
-               } else {
-+#ifndef HAVE_SSL_SET1_HOST
-+                      if(auth_name)
-+                        log_err("no name verification functionality in "
-+                              "ssl library, ignored name for %s", todo);
-+#endif
-                       /* add address */
-                       if(!delegpt_add_addr_mlc(dp, &addr, addrlen, 0, 0,
-                               auth_name)) {
-Index: iterator/iter_fwd.c
-===================================================================
---- a/iterator/iter_fwd.c
-+++ b/iterator/iter_fwd.c
-@@ -239,6 +239,11 @@
-                               s->name, p->str);
-                       return 0;
-               }
-+#ifndef HAVE_SSL_SET1_HOST
-+              if(tls_auth_name)
-+                      log_err("no name verification functionality in "
-+                              "ssl library, ignored name for %s", p->str);
-+#endif
-               if(!delegpt_add_addr_mlc(dp, &addr, addrlen, 0, 0,
-                       tls_auth_name)) {
-                       log_err("out of memory");
-Index: iterator/iter_hints.c
-===================================================================
---- a/iterator/iter_hints.c
-+++ b/iterator/iter_hints.c
-@@ -252,6 +252,11 @@
-                               s->name, p->str);
-                       return 0;
-               }
-+#ifndef HAVE_SSL_SET1_HOST
-+              if(auth_name)
-+                      log_err("no name verification functionality in "
-+                              "ssl library, ignored name for %s", p->str);
-+#endif
-               if(!delegpt_add_addr_mlc(dp, &addr, addrlen, 0, 0,
-                       auth_name)) {
-                       log_err("out of memory");
index 1cda1ae934bcb82a22c82ab1c786ed28e3489427..7bda797c98a617a0f3bd6369d62ab404ee12d18d 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wsdd2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/Andy2244/wsdd2.git
index 5f60f221615b9439beeeb7bdb4268f27a05d2938..0c59365a1c07551f59a4bddd2fc9b5bcbe6db942 100644 (file)
@@ -1,16 +1,19 @@
---- a/wsd.c    2018-07-20
-+++ b/wsd.c    2018-07-20
-@@ -97,12 +97,17 @@ static void uuid_endpoint(char *uuid, si
+--- a/wsd.c    2018-07-24
++++ b/wsd.c    2018-09-10
+@@ -96,13 +96,19 @@ static void uuid_endpoint(char *uuid, si
+ {
        FILE *fp = fopen("/etc/machine-id", "r");
        int c, i = 0;
++      
 +      if (!fp) {
-+              DEBUG(0, W, "Can't open '/etc/machine-id', trying '/proc/sys/kernel/random/boot_id'");
 +              fp = fopen("/proc/sys/kernel/random/boot_id", "r");
 +      }
-+              
-       if (!fp)
+-      if (!fp)
++      if (!fp) {
++              DEBUG(0, W, "Can't open required '/etc/machine-id' or '/proc/sys/kernel/random/boot_id'");
                return;
++      }
  
        while (i < 36 && (c = getc(fp)) != EOF &&
 -              (isdigit(c) || (islower(c) && isxdigit(c)))) {
index 816b1818393c79a93ba5520b783dd4097c562990..c5725aad981fe2c53c024ec953514e2b31655462 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zerotier
 PKG_VERSION:=1.2.12
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-3.0
 
@@ -66,10 +66,7 @@ ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
 endif
 
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) files/zerotier.init $(1)/etc/init.d/zerotier
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) files/zerotier.config $(1)/etc/config/zerotier
+       $(CP) ./files/* $(1)/
 endef
 
 $(eval $(call BuildPackage,zerotier))
diff --git a/net/zerotier/files/etc/config/zerotier b/net/zerotier/files/etc/config/zerotier
new file mode 100644 (file)
index 0000000..1a016eb
--- /dev/null
@@ -0,0 +1,15 @@
+
+config zerotier sample_config
+       option enabled 0
+
+       # persistent configuration folder (for ZT controller mode)
+       #option config_path '/etc/zerotier'
+
+       #option port '9993'
+
+       # Generate secret on first start
+       option secret ''
+
+       # Join a public network called Earth
+       list join '8056c2e21c000001'
+       #list join '<other_network>'
diff --git a/net/zerotier/files/etc/init.d/zerotier b/net/zerotier/files/etc/init.d/zerotier
new file mode 100755 (executable)
index 0000000..ba6b427
--- /dev/null
@@ -0,0 +1,103 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+
+USE_PROCD=1
+
+PROG=/usr/bin/zerotier-one
+CONFIG_PATH=/var/lib/zerotier-one
+
+section_enabled() {
+       config_get_bool enabled "$1" 'enabled' 0
+       [ $enabled -ne 0 ]
+}
+
+start_instance() {
+       local cfg="$1"
+       local port secret config_path path
+       local args=""
+
+       if ! section_enabled "$cfg"; then
+               echo "disabled in config"
+               return 1
+       fi
+
+       config_get config_path $cfg 'config_path'
+       config_get port $cfg 'port'
+       config_get secret $cfg 'secret'
+
+       path=${CONFIG_PATH}_$cfg
+
+       # Remove existing link or folder
+       rm -rf $path
+
+       # Create link from CONFIG_PATH to config_path
+       if [ -n "$config_path" -a "$config_path" != "$path" ]; then
+               if [ ! -d "$config_path" ]; then
+                       echo "ZeroTier config_path does not exist: $config_path" 1>&2
+                       return
+               fi
+
+               ln -s $config_path $path
+       fi
+
+       mkdir -p $path/networks.d
+
+       # link latest default config path to latest config path
+       rm -f $CONFIG_PATH
+       ln -s $path $CONFIG_PATH
+
+       if [ -n "$port" ]; then
+               args="$args -p${port}"
+       fi
+
+       if [ -z "$secret" ]; then
+               echo "Generate secret - please wait..."
+               local sf="/tmp/zt.$cfg.secret"
+
+               zerotier-idtool generate "$sf" > /dev/null
+               [ $? -ne 0 ] && return 1
+
+               secret="$(cat $sf)"
+               rm "$sf"
+
+               uci set zerotier.$cfg.secret="$secret"
+               uci commit zerotier
+       fi
+
+       if [ -n "$secret" ]; then
+               echo "$secret" > $path/identity.secret
+               # make sure there is not previous identity.public
+               rm -f $path/identity.public
+       fi
+
+       add_join() {
+               # an (empty) config file will cause ZT to join a network
+               touch $path/networks.d/$1.conf
+       }
+
+       config_list_foreach $cfg 'join' add_join
+
+       procd_open_instance
+       procd_set_param command $PROG $args $path
+       procd_set_param stderr 1
+       procd_close_instance
+}
+
+start_service() {
+       config_load 'zerotier'
+       config_foreach start_instance 'zerotier'
+}
+
+stop_instance() {
+       local cfg="$1"
+
+       # Remove existing link or folder
+       rm -rf ${CONFIG_PATH}_${cfg}
+}
+
+stop_service() {
+       config_load 'zerotier'
+       config_foreach stop_instance 'zerotier'
+       rm -f ${CONFIG_PATH}
+}
diff --git a/net/zerotier/files/zerotier.config b/net/zerotier/files/zerotier.config
deleted file mode 100644 (file)
index b62e155..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-
-config zerotier sample_config
-       option enabled 0
-
-       # persistent configuration folder (for ZT controller mode)
-       #option config_path '/etc/zerotier'
-
-       #option port '9993'
-
-       # Generate secret on first start
-       option secret 'generate'
-
-       # Join a public network called Earth
-       list join '8056c2e21c000001'
diff --git a/net/zerotier/files/zerotier.init b/net/zerotier/files/zerotier.init
deleted file mode 100644 (file)
index 390dbd3..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=90
-
-USE_PROCD=1
-
-PROG=/usr/bin/zerotier-one
-CONFIG_PATH=/var/lib/zerotier-one
-
-section_enabled() {
-       config_get_bool enabled "$1" 'enabled' 0
-       [ $enabled -gt 0 ]
-}
-
-start_instance() {
-       local cfg="$1"
-       local port secret config_path
-       local ARGS=""
-
-       if ! section_enabled "$cfg"; then
-               echo "disabled in config"
-               return 1
-       fi
-
-       config_get config_path $cfg 'config_path'
-       config_get_bool port $cfg 'port'
-       config_get secret $cfg 'secret'
-
-       # Remove existing link or folder
-       rm -rf $CONFIG_PATH
-
-       # Create link from CONFIG_PATH to config_path
-       if [ -n "$config_path" -a "$config_path" != $CONFIG_PATH ]; then
-               if [ ! -d "$config_path" ]; then
-                       echo "ZeroTier config_path does not exist: $config_path"
-                       return
-               fi
-
-               ln -s $config_path $CONFIG_PATH
-       fi
-
-       mkdir -p $CONFIG_PATH/networks.d
-
-       if [ -n "$port" ]; then
-               ARGS="$ARGS -p$port"
-       fi
-
-       if [ "$secret" = "generate" ]; then
-               echo "Generate secret - please wait..."
-               local sf="/tmp/zt.$cfg.secret"
-
-               zerotier-idtool generate "$sf" > /dev/null
-               [ $? -ne 0 ] && return 1
-
-               secret="$(cat $sf)"
-               rm "$sf"
-
-               uci set zerotier.$cfg.secret="$secret"
-               uci commit zerotier
-       fi
-
-       if [ -n "$secret" ]; then
-               echo "$secret" > $CONFIG_PATH/identity.secret
-               # make sure there is not previous identity.public
-               rm -f $CONFIG_PATH/identity.public
-       fi
-
-       add_join() {
-               # an (empty) config file will cause ZT to join a network
-               touch $CONFIG_PATH/networks.d/$1.conf
-       }
-
-       config_list_foreach $cfg 'join' add_join
-
-       procd_open_instance
-       procd_set_param command $PROG $ARGS $CONFIG_PATH
-       procd_set_param stderr 1
-       procd_close_instance
-}
-
-start_service() {
-       config_load 'zerotier'
-       config_foreach start_instance 'zerotier'
-}
-
-stop_instance() {
-       local cfg="$1"
-
-       # Remove existing link or folder
-       rm -rf $CONFIG_PATH
-}
-
-stop_service() {
-       config_load 'zerotier'
-       config_foreach stop_instance 'zerotier'
-}
index 8cb3572d056d5cb88febf3de1c0aa1a696b2a9c6..ee4aa66627e9ce2efd5f9ec21071e3bd6a9c6628 100644 (file)
@@ -1,6 +1,4 @@
 #
-# Copyright (C) 2014 OpenWrt.org
-#
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
@@ -9,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=espeak
 PKG_VERSION:=1.48.04
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
 PKG_SOURCE_URL:=@SF/espeak
@@ -45,6 +43,12 @@ MAKE_FLAGS+= \
 
 MAKE_PATH:=./src
 
+# Use system header for portaudio
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       rm $(PKG_BUILD_DIR)/src/portaudio.h
+endef
+
 define Package/espeak/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/
diff --git a/sound/espeak/patches/101-Fix_GCC_narrowing_conversion_errors.patch b/sound/espeak/patches/101-Fix_GCC_narrowing_conversion_errors.patch
new file mode 100644 (file)
index 0000000..e4ec57d
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/tr_languages.cpp
++++ b/src/tr_languages.cpp
+@@ -198,7 +198,7 @@ static const unsigned short chars_ignore
+       0x200d,  1, // zero width joiner
+       0, 0 };
+-const char string_ordinal[] = {0xc2,0xba,0};  // masculine ordinal character, UTF-8
++const unsigned char string_ordinal[] = {0xc2,0xba,0};  // masculine ordinal character, UTF-8
+ static Translator* NewTranslator(void)
+@@ -758,7 +758,7 @@ Translator *SelectTranslator(const char
+                               tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2;
+                               tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_ROMAN | NUM_ROMAN_ORDINAL;
+                               tr->langopts.numbers2 = NUM2_ORDINAL_NO_AND;
+-                              tr->langopts.roman_suffix = string_ordinal;
++                              tr->langopts.roman_suffix = (const char *)string_ordinal;
+                       }
+                       else
+                       if(name2 == L_pap)
diff --git a/sound/espeak/patches/101-portaudio.patch b/sound/espeak/patches/101-portaudio.patch
deleted file mode 100644 (file)
index ff396b3..0000000
+++ /dev/null
@@ -1,2093 +0,0 @@
---- a/src/portaudio.h
-+++ /dev/null
-@@ -1,466 +0,0 @@
--// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
--
--
--#ifndef PORT_AUDIO_H
--#define PORT_AUDIO_H
--
--#ifdef __cplusplus
--extern "C"
--{
--#endif /* __cplusplus */
--
--/*
-- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
-- * PortAudio Portable Real-Time Audio Library
-- * PortAudio API Header File
-- * Latest version available at: http://www.audiomulch.com/portaudio/
-- *
-- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
-- *
-- * Permission is hereby granted, free of charge, to any person obtaining
-- * a copy of this software and associated documentation files
-- * (the "Software"), to deal in the Software without restriction,
-- * including without limitation the rights to use, copy, modify, merge,
-- * publish, distribute, sublicense, and/or sell copies of the Software,
-- * and to permit persons to whom the Software is furnished to do so,
-- * subject to the following conditions:
-- *
-- * The above copyright notice and this permission notice shall be
-- * included in all copies or substantial portions of the Software.
-- *
-- * Any person wishing to distribute modifications to the Software is
-- * requested to send the modifications to the original developer so that
-- * they can be incorporated into the canonical version.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- *
-- */
--
--typedef int PaError;
--typedef enum {
--    paNoError = 0,
--
--    paHostError = -10000,
--    paInvalidChannelCount,
--    paInvalidSampleRate,
--    paInvalidDeviceId,
--    paInvalidFlag,
--    paSampleFormatNotSupported,
--    paBadIODeviceCombination,
--    paInsufficientMemory,
--    paBufferTooBig,
--    paBufferTooSmall,
--    paNullCallback,
--    paBadStreamPtr,
--    paTimedOut,
--    paInternalError,
--    paDeviceUnavailable
--} PaErrorNum;
--
--/*
-- Pa_Initialize() is the library initialisation function - call this before
-- using the library.
--
--*/
--
--PaError Pa_Initialize( void );
--
--/*
-- Pa_Terminate() is the library termination function - call this after
-- using the library.
--
--*/
--
--PaError Pa_Terminate( void );
--
--/*
-- Pa_GetHostError() returns a host specific error code.
-- This can be called after receiving a PortAudio error code of paHostError.
--
--*/
--
--long Pa_GetHostError( void );
--
--/*
-- Pa_GetErrorText() translates the supplied PortAudio error number
-- into a human readable message.
-- 
--*/
--
--const char *Pa_GetErrorText( PaError errnum );
--
--/*
-- Sample formats
-- 
-- These are formats used to pass sound data between the callback and the
-- stream. Each device has a "native" format which may be used when optimum
-- efficiency or control over conversion is required.
-- 
-- Formats marked "always available" are supported (emulated) by all 
-- PortAudio implementations.
-- 
-- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
-- maximum and minimum respectively.
--
-- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
--
--*/
--
--typedef unsigned long PaSampleFormat;
--#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
--#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
--#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
--#define paInt24        ((PaSampleFormat) (1<<3))
--#define paPackedInt24  ((PaSampleFormat) (1<<4))
--#define paInt8         ((PaSampleFormat) (1<<5))
--#define paUInt8        ((PaSampleFormat) (1<<6))
--#define paCustomFormat ((PaSampleFormat) (1<<16))
--
--/*
-- Device enumeration mechanism.
-- 
-- Device ids range from 0 to Pa_CountDevices()-1.
-- 
-- Devices may support input, output or both.
--
--*/
--
--typedef int PaDeviceID;
--#define paNoDevice -1
--
--int Pa_CountDevices( void );
--
--typedef struct
--{
--    int structVersion;
--    const char *name;
--    int maxInputChannels;
--    int maxOutputChannels;
--    /* Number of discrete rates, or -1 if range supported. */
--    int numSampleRates;
--    /* Array of supported sample rates, or {min,max} if range supported. */
--    const double *sampleRates;
--    PaSampleFormat nativeSampleFormats;
--}
--PaDeviceInfo;
--
--/*
-- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
-- default device ids for input and output respectively, or paNoDevice if
-- no device is available.
-- The result can be passed to Pa_OpenStream().
-- 
-- On the PC, the user can specify a default device by
-- setting an environment variable. For example, to use device #1.
-- 
--  set PA_RECOMMENDED_OUTPUT_DEVICE=1
-- 
-- The user should first determine the available device ids by using
-- the supplied application "pa_devs".
--
--*/
--
--PaDeviceID Pa_GetDefaultInputDeviceID( void );
--PaDeviceID Pa_GetDefaultOutputDeviceID( void );
--
--
--
--/*
-- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
-- for the device specified.
-- If the device parameter is out of range the function returns NULL.
--
-- PortAudio manages the memory referenced by the returned pointer, the client
-- must not manipulate or free the memory. The pointer is only guaranteed to be
-- valid between calls to Pa_Initialize() and Pa_Terminate().
--
--*/
--
--const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
--
--/*
-- PaTimestamp is used to represent a continuous sample clock with arbitrary
-- start time that can be used for syncronization. The type is used for the
-- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
--
--*/
--
--typedef double PaTimestamp;
--
--/*
-- PortAudioCallback is implemented by PortAudio clients.
-- 
-- inputBuffer and outputBuffer are arrays of interleaved samples,
-- the format, packing and number of channels used by the buffers are
-- determined by parameters to Pa_OpenStream() (see below).
-- 
-- framesPerBuffer is the number of sample frames to be processed by the callback.
-- 
-- outTime is the time in samples when the buffer(s) processed by
-- this callback will begin being played at the audio output.
-- See also Pa_StreamTime()
-- 
-- userData is the value of a user supplied pointer passed to Pa_OpenStream()
-- intended for storing synthesis data etc.
-- 
-- return value:
-- The callback can return a non-zero value to stop the stream. This may be
-- useful in applications such as soundfile players where a specific duration
-- of output is required. However, it is not necessary to utilise this mechanism
-- as StopStream() will also terminate the stream. A callback returning a
-- non-zero value must fill the entire outputBuffer.
-- 
-- NOTE: None of the other stream functions may be called from within the
-- callback function except for Pa_GetCPULoad().
--
--*/
--
--typedef int (PortAudioCallback)(
--    void *inputBuffer, void *outputBuffer,
--    unsigned long framesPerBuffer,
--    PaTimestamp outTime, void *userData );
--
--
--/*
-- Stream flags
-- 
-- These flags may be supplied (ored together) in the streamFlags argument to
-- the Pa_OpenStream() function.
--
--*/
--
--#define   paNoFlag      (0)
--#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
--#define   paDitherOff   (1<<1)   /* disable default dithering */
--#define   paPlatformSpecificFlags (0x00010000)
--typedef   unsigned long PaStreamFlags;
--
--/*
-- A single PortAudioStream provides multiple channels of real-time
-- input and output audio streaming to a client application.
-- Pointers to PortAudioStream objects are passed between PortAudio functions.
--*/
--
--typedef void PortAudioStream;
--#define PaStream PortAudioStream
--
--/*
-- Pa_OpenStream() opens a stream for either input, output or both.
-- 
-- stream is the address of a PortAudioStream pointer which will receive
-- a pointer to the newly opened stream.
-- 
-- inputDevice is the id of the device used for input (see PaDeviceID above.)
-- inputDevice may be paNoDevice to indicate that an input device is not required.
-- 
-- numInputChannels is the number of channels of sound to be delivered to the
-- callback. It can range from 1 to the value of maxInputChannels in the
-- PaDeviceInfo record for the device specified by the inputDevice parameter.
-- If inputDevice is paNoDevice numInputChannels is ignored.
-- 
-- inputSampleFormat is the sample format of inputBuffer provided to the callback
-- function. inputSampleFormat may be any of the formats described by the
-- PaSampleFormat enumeration (see above). PortAudio guarantees support for
-- the device's native formats (nativeSampleFormats in the device info record)
-- and additionally 16 and 32 bit integer and 32 bit floating point formats.
-- Support for other formats is implementation defined.
-- 
-- inputDriverInfo is a pointer to an optional driver specific data structure
-- containing additional information for device setup or stream processing.
-- inputDriverInfo is never required for correct operation. If not used
-- inputDriverInfo should be NULL.
-- 
-- outputDevice is the id of the device used for output (see PaDeviceID above.)
-- outputDevice may be paNoDevice to indicate that an output device is not required.
-- 
-- numOutputChannels is the number of channels of sound to be supplied by the
-- callback. See the definition of numInputChannels above for more details.
-- 
-- outputSampleFormat is the sample format of the outputBuffer filled by the
-- callback function. See the definition of inputSampleFormat above for more
-- details.
-- 
-- outputDriverInfo is a pointer to an optional driver specific data structure
-- containing additional information for device setup or stream processing.
-- outputDriverInfo is never required for correct operation. If not used
-- outputDriverInfo should be NULL.
-- 
-- sampleRate is the desired sampleRate. For full-duplex streams it is the
-- sample rate for both input and output
-- 
-- framesPerBuffer is the length in sample frames of all internal sample buffers
-- used for communication with platform specific audio routines. Wherever
-- possible this corresponds to the framesPerBuffer parameter passed to the
-- callback function.
-- 
-- numberOfBuffers is the number of buffers used for multibuffered communication
-- with the platform specific audio routines. If you pass zero, then an optimum
-- value will be chosen for you internally. This parameter is provided only
-- as a guide - and does not imply that an implementation must use multibuffered
-- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
-- on the Macintosh.)
-- 
-- streamFlags may contain a combination of flags ORed together.
-- These flags modify the behaviour of the streaming process. Some flags may only
-- be relevant to certain buffer formats.
-- 
-- callback is a pointer to a client supplied function that is responsible
-- for processing and filling input and output buffers (see above for details.)
-- 
-- userData is a client supplied pointer which is passed to the callback
-- function. It could for example, contain a pointer to instance data necessary
-- for processing the audio buffers.
-- 
-- return value:
-- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
-- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
-- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
-- PaError above) and the value of stream is invalid.
-- 
--*/
--
--PaError Pa_OpenStream( PortAudioStream** stream,
--                       PaDeviceID inputDevice,
--                       int numInputChannels,
--                       PaSampleFormat inputSampleFormat,
--                       void *inputDriverInfo,
--                       PaDeviceID outputDevice,
--                       int numOutputChannels,
--                       PaSampleFormat outputSampleFormat,
--                       void *outputDriverInfo,
--                       double sampleRate,
--                       unsigned long framesPerBuffer,
--                       unsigned long numberOfBuffers,
--                       PaStreamFlags streamFlags,
--                       PortAudioCallback *callback,
--                       void *userData );
--
--
--/*
-- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
-- the default input and/or output devices. Most parameters have identical meaning
-- to their Pa_OpenStream() counterparts, with the following exceptions:
-- 
-- If either numInputChannels or numOutputChannels is 0 the respective device
-- is not opened. This has the same effect as passing paNoDevice in the device
-- arguments to Pa_OpenStream().
-- 
-- sampleFormat applies to both the input and output buffers.
--
--*/
--
--PaError Pa_OpenDefaultStream( PortAudioStream** stream,
--                              int numInputChannels,
--                              int numOutputChannels,
--                              PaSampleFormat sampleFormat,
--                              double sampleRate,
--                              unsigned long framesPerBuffer,
--                              unsigned long numberOfBuffers,
--                              PortAudioCallback *callback,
--                              void *userData );
--
--/*
-- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
--
--*/
--
--PaError Pa_CloseStream( PortAudioStream* );
--
--/*
-- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
-- Pa_StopStream() waits until all pending audio buffers have been played.
-- Pa_AbortStream() stops playing immediately without waiting for pending
-- buffers to complete.
--    
--*/
--
--PaError Pa_StartStream( PortAudioStream *stream );
--
--PaError Pa_StopStream( PortAudioStream *stream );
--
--PaError Pa_AbortStream( PortAudioStream *stream );
--
--/*
-- Pa_StreamActive() returns one (1) when the stream is active (ie playing
-- or recording audio), zero (0) when not playing, or a negative error number
-- if the stream is invalid.
-- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
-- but may also become inactive if the callback returns a non-zero value.
-- In the latter case, the stream is considered inactive after the last
-- buffer has finished playing.
-- 
--*/
--
--PaError Pa_StreamActive( PortAudioStream *stream );
--
--/*
-- Pa_StreamTime() returns the current output time in samples for the stream.
-- This time may be used as a time reference (for example synchronizing audio to
-- MIDI).
-- 
--*/
--
--PaTimestamp Pa_StreamTime( PortAudioStream *stream );
--
--/*
-- Pa_GetCPULoad() returns the CPU Load for the stream.
-- The "CPU Load" is a fraction of total CPU time consumed by the stream's
-- audio processing routines including, but not limited to the client supplied
-- callback.
-- A value of 0.5 would imply that PortAudio and the sound generating
-- callback was consuming roughly 50% of the available CPU time.
-- This function may be called from the callback function or the application.
-- 
--*/
--
--double Pa_GetCPULoad( PortAudioStream* stream );
--
--/*
-- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
-- the current host based on minimum latency.
-- On the PC, for the DirectSound implementation, latency can be optionally set
-- by user by setting an environment variable.
-- For example, to set latency to 200 msec, put:
-- 
--    set PA_MIN_LATENCY_MSEC=200
-- 
-- in the AUTOEXEC.BAT file and reboot.
-- If the environment variable is not set, then the latency will be determined
-- based on the OS. Windows NT has higher latency than Win95.
-- 
--*/
--
--int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
--
--/*
-- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
-- You may sleep longer than the requested time so don't rely on this for
-- accurate musical timing.
-- 
-- Pa_Sleep() is provided as a convenience for authors of portable code (such as
-- the tests and examples in the PortAudio distribution.)
-- 
--*/
--
--void Pa_Sleep( long msec );
--
--/*
-- Pa_GetSampleSize() returns the size in bytes of a single sample in the
-- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
-- no supported.
--  
--*/
--
--PaError Pa_GetSampleSize( PaSampleFormat format );
--
--
--#ifdef __cplusplus
--}
--#endif /* __cplusplus */
--#endif /* PORT_AUDIO_H */
---- a/src/portaudio18.h
-+++ /dev/null
-@@ -1,466 +0,0 @@
--// NOTE: Copy this file to  portaudio.h  in order to compile with V18 portaudio
--
--
--#ifndef PORT_AUDIO_H
--#define PORT_AUDIO_H
--
--#ifdef __cplusplus
--extern "C"
--{
--#endif /* __cplusplus */
--
--/*
-- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
-- * PortAudio Portable Real-Time Audio Library
-- * PortAudio API Header File
-- * Latest version available at: http://www.audiomulch.com/portaudio/
-- *
-- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
-- *
-- * Permission is hereby granted, free of charge, to any person obtaining
-- * a copy of this software and associated documentation files
-- * (the "Software"), to deal in the Software without restriction,
-- * including without limitation the rights to use, copy, modify, merge,
-- * publish, distribute, sublicense, and/or sell copies of the Software,
-- * and to permit persons to whom the Software is furnished to do so,
-- * subject to the following conditions:
-- *
-- * The above copyright notice and this permission notice shall be
-- * included in all copies or substantial portions of the Software.
-- *
-- * Any person wishing to distribute modifications to the Software is
-- * requested to send the modifications to the original developer so that
-- * they can be incorporated into the canonical version.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- *
-- */
--
--typedef int PaError;
--typedef enum {
--    paNoError = 0,
--
--    paHostError = -10000,
--    paInvalidChannelCount,
--    paInvalidSampleRate,
--    paInvalidDeviceId,
--    paInvalidFlag,
--    paSampleFormatNotSupported,
--    paBadIODeviceCombination,
--    paInsufficientMemory,
--    paBufferTooBig,
--    paBufferTooSmall,
--    paNullCallback,
--    paBadStreamPtr,
--    paTimedOut,
--    paInternalError,
--    paDeviceUnavailable
--} PaErrorNum;
--
--/*
-- Pa_Initialize() is the library initialisation function - call this before
-- using the library.
--
--*/
--
--PaError Pa_Initialize( void );
--
--/*
-- Pa_Terminate() is the library termination function - call this after
-- using the library.
--
--*/
--
--PaError Pa_Terminate( void );
--
--/*
-- Pa_GetHostError() returns a host specific error code.
-- This can be called after receiving a PortAudio error code of paHostError.
--
--*/
--
--long Pa_GetHostError( void );
--
--/*
-- Pa_GetErrorText() translates the supplied PortAudio error number
-- into a human readable message.
-- 
--*/
--
--const char *Pa_GetErrorText( PaError errnum );
--
--/*
-- Sample formats
-- 
-- These are formats used to pass sound data between the callback and the
-- stream. Each device has a "native" format which may be used when optimum
-- efficiency or control over conversion is required.
-- 
-- Formats marked "always available" are supported (emulated) by all 
-- PortAudio implementations.
-- 
-- The floating point representation (paFloat32) uses +1.0 and -1.0 as the 
-- maximum and minimum respectively.
--
-- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
--
--*/
--
--typedef unsigned long PaSampleFormat;
--#define paFloat32      ((PaSampleFormat) (1<<0)) /*always available*/
--#define paInt16        ((PaSampleFormat) (1<<1)) /*always available*/
--#define paInt32        ((PaSampleFormat) (1<<2)) /*always available*/
--#define paInt24        ((PaSampleFormat) (1<<3))
--#define paPackedInt24  ((PaSampleFormat) (1<<4))
--#define paInt8         ((PaSampleFormat) (1<<5))
--#define paUInt8        ((PaSampleFormat) (1<<6))
--#define paCustomFormat ((PaSampleFormat) (1<<16))
--
--/*
-- Device enumeration mechanism.
-- 
-- Device ids range from 0 to Pa_CountDevices()-1.
-- 
-- Devices may support input, output or both.
--
--*/
--
--typedef int PaDeviceID;
--#define paNoDevice -1
--
--int Pa_CountDevices( void );
--
--typedef struct
--{
--    int structVersion;
--    const char *name;
--    int maxInputChannels;
--    int maxOutputChannels;
--    /* Number of discrete rates, or -1 if range supported. */
--    int numSampleRates;
--    /* Array of supported sample rates, or {min,max} if range supported. */
--    const double *sampleRates;
--    PaSampleFormat nativeSampleFormats;
--}
--PaDeviceInfo;
--
--/*
-- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
-- default device ids for input and output respectively, or paNoDevice if
-- no device is available.
-- The result can be passed to Pa_OpenStream().
-- 
-- On the PC, the user can specify a default device by
-- setting an environment variable. For example, to use device #1.
-- 
--  set PA_RECOMMENDED_OUTPUT_DEVICE=1
-- 
-- The user should first determine the available device ids by using
-- the supplied application "pa_devs".
--
--*/
--
--PaDeviceID Pa_GetDefaultInputDeviceID( void );
--PaDeviceID Pa_GetDefaultOutputDeviceID( void );
--
--
--
--/*
-- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
-- for the device specified.
-- If the device parameter is out of range the function returns NULL.
--
-- PortAudio manages the memory referenced by the returned pointer, the client
-- must not manipulate or free the memory. The pointer is only guaranteed to be
-- valid between calls to Pa_Initialize() and Pa_Terminate().
--
--*/
--
--const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
--
--/*
-- PaTimestamp is used to represent a continuous sample clock with arbitrary
-- start time that can be used for syncronization. The type is used for the
-- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
--
--*/
--
--typedef double PaTimestamp;
--
--/*
-- PortAudioCallback is implemented by PortAudio clients.
-- 
-- inputBuffer and outputBuffer are arrays of interleaved samples,
-- the format, packing and number of channels used by the buffers are
-- determined by parameters to Pa_OpenStream() (see below).
-- 
-- framesPerBuffer is the number of sample frames to be processed by the callback.
-- 
-- outTime is the time in samples when the buffer(s) processed by
-- this callback will begin being played at the audio output.
-- See also Pa_StreamTime()
-- 
-- userData is the value of a user supplied pointer passed to Pa_OpenStream()
-- intended for storing synthesis data etc.
-- 
-- return value:
-- The callback can return a non-zero value to stop the stream. This may be
-- useful in applications such as soundfile players where a specific duration
-- of output is required. However, it is not necessary to utilise this mechanism
-- as StopStream() will also terminate the stream. A callback returning a
-- non-zero value must fill the entire outputBuffer.
-- 
-- NOTE: None of the other stream functions may be called from within the
-- callback function except for Pa_GetCPULoad().
--
--*/
--
--typedef int (PortAudioCallback)(
--    void *inputBuffer, void *outputBuffer,
--    unsigned long framesPerBuffer,
--    PaTimestamp outTime, void *userData );
--
--
--/*
-- Stream flags
-- 
-- These flags may be supplied (ored together) in the streamFlags argument to
-- the Pa_OpenStream() function.
--
--*/
--
--#define   paNoFlag      (0)
--#define   paClipOff     (1<<0)   /* disable default clipping of out of range samples */
--#define   paDitherOff   (1<<1)   /* disable default dithering */
--#define   paPlatformSpecificFlags (0x00010000)
--typedef   unsigned long PaStreamFlags;
--
--/*
-- A single PortAudioStream provides multiple channels of real-time
-- input and output audio streaming to a client application.
-- Pointers to PortAudioStream objects are passed between PortAudio functions.
--*/
--
--typedef void PortAudioStream;
--#define PaStream PortAudioStream
--
--/*
-- Pa_OpenStream() opens a stream for either input, output or both.
-- 
-- stream is the address of a PortAudioStream pointer which will receive
-- a pointer to the newly opened stream.
-- 
-- inputDevice is the id of the device used for input (see PaDeviceID above.)
-- inputDevice may be paNoDevice to indicate that an input device is not required.
-- 
-- numInputChannels is the number of channels of sound to be delivered to the
-- callback. It can range from 1 to the value of maxInputChannels in the
-- PaDeviceInfo record for the device specified by the inputDevice parameter.
-- If inputDevice is paNoDevice numInputChannels is ignored.
-- 
-- inputSampleFormat is the sample format of inputBuffer provided to the callback
-- function. inputSampleFormat may be any of the formats described by the
-- PaSampleFormat enumeration (see above). PortAudio guarantees support for
-- the device's native formats (nativeSampleFormats in the device info record)
-- and additionally 16 and 32 bit integer and 32 bit floating point formats.
-- Support for other formats is implementation defined.
-- 
-- inputDriverInfo is a pointer to an optional driver specific data structure
-- containing additional information for device setup or stream processing.
-- inputDriverInfo is never required for correct operation. If not used
-- inputDriverInfo should be NULL.
-- 
-- outputDevice is the id of the device used for output (see PaDeviceID above.)
-- outputDevice may be paNoDevice to indicate that an output device is not required.
-- 
-- numOutputChannels is the number of channels of sound to be supplied by the
-- callback. See the definition of numInputChannels above for more details.
-- 
-- outputSampleFormat is the sample format of the outputBuffer filled by the
-- callback function. See the definition of inputSampleFormat above for more
-- details.
-- 
-- outputDriverInfo is a pointer to an optional driver specific data structure
-- containing additional information for device setup or stream processing.
-- outputDriverInfo is never required for correct operation. If not used
-- outputDriverInfo should be NULL.
-- 
-- sampleRate is the desired sampleRate. For full-duplex streams it is the
-- sample rate for both input and output
-- 
-- framesPerBuffer is the length in sample frames of all internal sample buffers
-- used for communication with platform specific audio routines. Wherever
-- possible this corresponds to the framesPerBuffer parameter passed to the
-- callback function.
-- 
-- numberOfBuffers is the number of buffers used for multibuffered communication
-- with the platform specific audio routines. If you pass zero, then an optimum
-- value will be chosen for you internally. This parameter is provided only
-- as a guide - and does not imply that an implementation must use multibuffered
-- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
-- on the Macintosh.)
-- 
-- streamFlags may contain a combination of flags ORed together.
-- These flags modify the behaviour of the streaming process. Some flags may only
-- be relevant to certain buffer formats.
-- 
-- callback is a pointer to a client supplied function that is responsible
-- for processing and filling input and output buffers (see above for details.)
-- 
-- userData is a client supplied pointer which is passed to the callback
-- function. It could for example, contain a pointer to instance data necessary
-- for processing the audio buffers.
-- 
-- return value:
-- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
-- valid PortAudioStream in the stream argument. The stream is inactive (stopped).
-- If a call to Pa_OpenStream() fails a non-zero error code is returned (see
-- PaError above) and the value of stream is invalid.
-- 
--*/
--
--PaError Pa_OpenStream( PortAudioStream** stream,
--                       PaDeviceID inputDevice,
--                       int numInputChannels,
--                       PaSampleFormat inputSampleFormat,
--                       void *inputDriverInfo,
--                       PaDeviceID outputDevice,
--                       int numOutputChannels,
--                       PaSampleFormat outputSampleFormat,
--                       void *outputDriverInfo,
--                       double sampleRate,
--                       unsigned long framesPerBuffer,
--                       unsigned long numberOfBuffers,
--                       PaStreamFlags streamFlags,
--                       PortAudioCallback *callback,
--                       void *userData );
--
--
--/*
-- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
-- the default input and/or output devices. Most parameters have identical meaning
-- to their Pa_OpenStream() counterparts, with the following exceptions:
-- 
-- If either numInputChannels or numOutputChannels is 0 the respective device
-- is not opened. This has the same effect as passing paNoDevice in the device
-- arguments to Pa_OpenStream().
-- 
-- sampleFormat applies to both the input and output buffers.
--
--*/
--
--PaError Pa_OpenDefaultStream( PortAudioStream** stream,
--                              int numInputChannels,
--                              int numOutputChannels,
--                              PaSampleFormat sampleFormat,
--                              double sampleRate,
--                              unsigned long framesPerBuffer,
--                              unsigned long numberOfBuffers,
--                              PortAudioCallback *callback,
--                              void *userData );
--
--/*
-- Pa_CloseStream() closes an audio stream, flushing any pending buffers.
--
--*/
--
--PaError Pa_CloseStream( PortAudioStream* );
--
--/*
-- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
-- Pa_StopStream() waits until all pending audio buffers have been played.
-- Pa_AbortStream() stops playing immediately without waiting for pending
-- buffers to complete.
--    
--*/
--
--PaError Pa_StartStream( PortAudioStream *stream );
--
--PaError Pa_StopStream( PortAudioStream *stream );
--
--PaError Pa_AbortStream( PortAudioStream *stream );
--
--/*
-- Pa_StreamActive() returns one (1) when the stream is active (ie playing
-- or recording audio), zero (0) when not playing, or a negative error number
-- if the stream is invalid.
-- The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
-- but may also become inactive if the callback returns a non-zero value.
-- In the latter case, the stream is considered inactive after the last
-- buffer has finished playing.
-- 
--*/
--
--PaError Pa_StreamActive( PortAudioStream *stream );
--
--/*
-- Pa_StreamTime() returns the current output time in samples for the stream.
-- This time may be used as a time reference (for example synchronizing audio to
-- MIDI).
-- 
--*/
--
--PaTimestamp Pa_StreamTime( PortAudioStream *stream );
--
--/*
-- Pa_GetCPULoad() returns the CPU Load for the stream.
-- The "CPU Load" is a fraction of total CPU time consumed by the stream's
-- audio processing routines including, but not limited to the client supplied
-- callback.
-- A value of 0.5 would imply that PortAudio and the sound generating
-- callback was consuming roughly 50% of the available CPU time.
-- This function may be called from the callback function or the application.
-- 
--*/
--
--double Pa_GetCPULoad( PortAudioStream* stream );
--
--/*
-- Pa_GetMinNumBuffers() returns the minimum number of buffers required by
-- the current host based on minimum latency.
-- On the PC, for the DirectSound implementation, latency can be optionally set
-- by user by setting an environment variable.
-- For example, to set latency to 200 msec, put:
-- 
--    set PA_MIN_LATENCY_MSEC=200
-- 
-- in the AUTOEXEC.BAT file and reboot.
-- If the environment variable is not set, then the latency will be determined
-- based on the OS. Windows NT has higher latency than Win95.
-- 
--*/
--
--int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
--
--/*
-- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
-- You may sleep longer than the requested time so don't rely on this for
-- accurate musical timing.
-- 
-- Pa_Sleep() is provided as a convenience for authors of portable code (such as
-- the tests and examples in the PortAudio distribution.)
-- 
--*/
--
--void Pa_Sleep( long msec );
--
--/*
-- Pa_GetSampleSize() returns the size in bytes of a single sample in the
-- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
-- no supported.
--  
--*/
--
--PaError Pa_GetSampleSize( PaSampleFormat format );
--
--
--#ifdef __cplusplus
--}
--#endif /* __cplusplus */
--#endif /* PORT_AUDIO_H */
---- a/src/portaudio19.h
-+++ /dev/null
-@@ -1,1127 +0,0 @@
--// NOTE: Copy this file to  portaudio.h  in order to compile with V19 portaudio
--
--#ifndef PORTAUDIO_H
--#define PORTAUDIO_H
--/*
-- * $Id: portaudio.h 1061 2006-06-19 22:46:41Z lschwardt $
-- * PortAudio Portable Real-Time Audio Library
-- * PortAudio API Header File
-- * Latest version available at: http://www.portaudio.com/
-- *
-- * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
-- *
-- * Permission is hereby granted, free of charge, to any person obtaining
-- * a copy of this software and associated documentation files
-- * (the "Software"), to deal in the Software without restriction,
-- * including without limitation the rights to use, copy, modify, merge,
-- * publish, distribute, sublicense, and/or sell copies of the Software,
-- * and to permit persons to whom the Software is furnished to do so,
-- * subject to the following conditions:
-- *
-- * The above copyright notice and this permission notice shall be
-- * included in all copies or substantial portions of the Software.
-- *
-- * Any person wishing to distribute modifications to the Software is
-- * requested to send the modifications to the original developer so that
-- * they can be incorporated into the canonical version.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- */
--
--/** @file
-- @brief The PortAudio API.
--*/
--
--
--#ifdef __cplusplus
--extern "C"
--{
--#endif /* __cplusplus */
--
-- 
--/** Retrieve the release number of the currently running PortAudio build,
-- eg 1900.
--*/
--int Pa_GetVersion( void );
--
--
--/** Retrieve a textual description of the current PortAudio build,
-- eg "PortAudio V19-devel 13 October 2002".
--*/
--const char* Pa_GetVersionText( void );
--
--
--/** Error codes returned by PortAudio functions.
-- Note that with the exception of paNoError, all PaErrorCodes are negative.
--*/
--
--typedef int PaError;
--typedef enum PaErrorCode
--{
--    paNoError = 0,
--
--    paNotInitialized = -10000,
--    paUnanticipatedHostError,
--    paInvalidChannelCount,
--    paInvalidSampleRate,
--    paInvalidDevice,
--    paInvalidFlag,
--    paSampleFormatNotSupported,
--    paBadIODeviceCombination,
--    paInsufficientMemory,
--    paBufferTooBig,
--    paBufferTooSmall,
--    paNullCallback,
--    paBadStreamPtr,
--    paTimedOut,
--    paInternalError,
--    paDeviceUnavailable,
--    paIncompatibleHostApiSpecificStreamInfo,
--    paStreamIsStopped,
--    paStreamIsNotStopped,
--    paInputOverflowed,
--    paOutputUnderflowed,
--    paHostApiNotFound,
--    paInvalidHostApi,
--    paCanNotReadFromACallbackStream,      /**< @todo review error code name */
--    paCanNotWriteToACallbackStream,       /**< @todo review error code name */
--    paCanNotReadFromAnOutputOnlyStream,   /**< @todo review error code name */
--    paCanNotWriteToAnInputOnlyStream,     /**< @todo review error code name */
--    paIncompatibleStreamHostApi,
--    paBadBufferPtr
--} PaErrorCode;
--
--
--/** Translate the supplied PortAudio error code into a human readable
-- message.
--*/
--const char *Pa_GetErrorText( PaError errorCode );
--
--
--/** Library initialization function - call this before using PortAudio.
-- This function initialises internal data structures and prepares underlying
-- host APIs for use. This function MUST be called before using any other
-- PortAudio API functions.
--
-- If Pa_Initialize() is called multiple times, each successful 
-- call must be matched with a corresponding call to Pa_Terminate(). 
-- Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not 
-- required to be fully nested.
--
-- Note that if Pa_Initialize() returns an error code, Pa_Terminate() should
-- NOT be called.
--
-- @return paNoError if successful, otherwise an error code indicating the cause
-- of failure.
--
-- @see Pa_Terminate
--*/
--PaError Pa_Initialize( void );
--
--
--/** Library termination function - call this when finished using PortAudio.
-- This function deallocates all resources allocated by PortAudio since it was
-- initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has
-- been called multiple times, each call must be matched with a corresponding call
-- to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically
-- close any PortAudio streams that are still open.
--
-- Pa_Terminate() MUST be called before exiting a program which uses PortAudio.
-- Failure to do so may result in serious resource leaks, such as audio devices
-- not being available until the next reboot.
--
-- @return paNoError if successful, otherwise an error code indicating the cause
-- of failure.
-- 
-- @see Pa_Initialize
--*/
--PaError Pa_Terminate( void );
--
--
--
--/** The type used to refer to audio devices. Values of this type usually
-- range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice
-- and paUseHostApiSpecificDeviceSpecification values.
--
-- @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification
--*/
--typedef int PaDeviceIndex;
--
--
--/** A special PaDeviceIndex value indicating that no device is available,
-- or should be used.
--
-- @see PaDeviceIndex
--*/
--#define paNoDevice ((PaDeviceIndex)-1)
--
--
--/** A special PaDeviceIndex value indicating that the device(s) to be used
-- are specified in the host api specific stream info structure.
--
-- @see PaDeviceIndex
--*/
--#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2)
--
--
--/* Host API enumeration mechanism */
--
--/** The type used to enumerate to host APIs at runtime. Values of this type
-- range from 0 to (Pa_GetHostApiCount()-1).
--
-- @see Pa_GetHostApiCount
--*/
--typedef int PaHostApiIndex;
--
--
--/** Retrieve the number of available host APIs. Even if a host API is
-- available it may have no devices available.
--
-- @return A non-negative value indicating the number of available host APIs
-- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
-- or an error is encountered.
--
-- @see PaHostApiIndex
--*/
--PaHostApiIndex Pa_GetHostApiCount( void );
--
--
--/** Retrieve the index of the default host API. The default host API will be
-- the lowest common denominator host API on the current platform and is
-- unlikely to provide the best performance.
--
-- @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1)
-- indicating the default host API index or, a PaErrorCode (which are always
-- negative) if PortAudio is not initialized or an error is encountered.
--*/
--PaHostApiIndex Pa_GetDefaultHostApi( void );
--
--
--/** Unchanging unique identifiers for each supported host API. This type
-- is used in the PaHostApiInfo structure. The values are guaranteed to be
-- unique and to never change, thus allowing code to be written that
-- conditionally uses host API specific extensions.
--
-- New type ids will be allocated when support for a host API reaches
-- "public alpha" status, prior to that developers should use the
-- paInDevelopment type id.
--
-- @see PaHostApiInfo
--*/
--typedef enum PaHostApiTypeId
--{
--    paInDevelopment=0, /* use while developing support for a new host API */
--    paDirectSound=1,
--    paMME=2,
--    paASIO=3,
--    paSoundManager=4,
--    paCoreAudio=5,
--    paOSS=7,
--    paALSA=8,
--    paAL=9,
--    paBeOS=10,
--    paWDMKS=11,
--    paJACK=12,
--    paWASAPI=13,
--    paAudioScienceHPI=14
--} PaHostApiTypeId;
--
--
--/** A structure containing information about a particular host API. */
--
--typedef struct PaHostApiInfo
--{
--    /** this is struct version 1 */
--    int structVersion;
--    /** The well known unique identifier of this host API @see PaHostApiTypeId */
--    PaHostApiTypeId type;
--    /** A textual description of the host API for display on user interfaces. */
--    const char *name;
--
--    /**  The number of devices belonging to this host API. This field may be
--     used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate
--     all devices for this host API.
--     @see Pa_HostApiDeviceIndexToDeviceIndex
--    */
--    int deviceCount;
--
--    /** The default input device for this host API. The value will be a
--     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
--     if no default input device is available.
--    */
--    PaDeviceIndex defaultInputDevice;
--
--    /** The default output device for this host API. The value will be a
--     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
--     if no default output device is available.
--    */
--    PaDeviceIndex defaultOutputDevice;
--    
--} PaHostApiInfo;
--
--
--/** Retrieve a pointer to a structure containing information about a specific
-- host Api.
--
-- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
--
-- @return A pointer to an immutable PaHostApiInfo structure describing
-- a specific host API. If the hostApi parameter is out of range or an error
-- is encountered, the function returns NULL.
--
-- The returned structure is owned by the PortAudio implementation and must not
-- be manipulated or freed. The pointer is only guaranteed to be valid between
-- calls to Pa_Initialize() and Pa_Terminate().
--*/
--const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi );
--
--
--/** Convert a static host API unique identifier, into a runtime
-- host API index.
--
-- @param type A unique host API identifier belonging to the PaHostApiTypeId
-- enumeration.
--
-- @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or,
-- a PaErrorCode (which are always negative) if PortAudio is not initialized
-- or an error is encountered.
-- 
-- The paHostApiNotFound error code indicates that the host API specified by the
-- type parameter is not available.
--
-- @see PaHostApiTypeId
--*/
--PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type );
--
--
--/** Convert a host-API-specific device index to standard PortAudio device index.
-- This function may be used in conjunction with the deviceCount field of
-- PaHostApiInfo to enumerate all devices for the specified host API.
--
-- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
--
-- @param hostApiDeviceIndex A valid per-host device index in the range
-- 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1)
--
-- @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1)
-- or, a PaErrorCode (which are always negative) if PortAudio is not initialized
-- or an error is encountered.
--
-- A paInvalidHostApi error code indicates that the host API index specified by
-- the hostApi parameter is out of range.
--
-- A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter
-- is out of range.
-- 
-- @see PaHostApiInfo
--*/
--PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi,
--        int hostApiDeviceIndex );
--
--
--
--/** Structure used to return information about a host error condition.
--*/
--typedef struct PaHostErrorInfo{
--    PaHostApiTypeId hostApiType;    /**< the host API which returned the error code */
--    long errorCode;                 /**< the error code returned */
--    const char *errorText;          /**< a textual description of the error if available, otherwise a zero-length string */
--}PaHostErrorInfo;
--
--
--/** Return information about the last host error encountered. The error
-- information returned by Pa_GetLastHostErrorInfo() will never be modified
-- asyncronously by errors occurring in other PortAudio owned threads
-- (such as the thread that manages the stream callback.)
--
-- This function is provided as a last resort, primarily to enhance debugging
-- by providing clients with access to all available error information.
--
-- @return A pointer to an immutable structure constaining information about
-- the host error. The values in this structure will only be valid if a
-- PortAudio function has previously returned the paUnanticipatedHostError
-- error code.
--*/
--const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void );
--
--
--
--/* Device enumeration and capabilities */
--
--/** Retrieve the number of available devices. The number of available devices
-- may be zero.
--
-- @return A non-negative value indicating the number of available devices or,
-- a PaErrorCode (which are always negative) if PortAudio is not initialized
-- or an error is encountered.
--*/
--PaDeviceIndex Pa_GetDeviceCount( void );
--
--
--/** Retrieve the index of the default input device. The result can be
-- used in the inputDevice parameter to Pa_OpenStream().
--
-- @return The default input device index for the default host API, or paNoDevice
-- if no default input device is available or an error was encountered.
--*/
--PaDeviceIndex Pa_GetDefaultInputDevice( void );
--
--
--/** Retrieve the index of the default output device. The result can be
-- used in the outputDevice parameter to Pa_OpenStream().
--
-- @return The default output device index for the defualt host API, or paNoDevice
-- if no default output device is available or an error was encountered.
--
-- @note
-- On the PC, the user can specify a default device by
-- setting an environment variable. For example, to use device #1.
--<pre>
-- set PA_RECOMMENDED_OUTPUT_DEVICE=1
--</pre>
-- The user should first determine the available device ids by using
-- the supplied application "pa_devs".
--*/
--PaDeviceIndex Pa_GetDefaultOutputDevice( void );
--
--
--/** The type used to represent monotonic time in seconds that can be used
-- for syncronisation. The type is used for the outTime argument to the
-- PaStreamCallback and as the result of Pa_GetStreamTime().
--     
-- @see PaStreamCallback, Pa_GetStreamTime
--*/
--typedef double PaTime;
--
--
--/** A type used to specify one or more sample formats. Each value indicates
-- a possible format for sound data passed to and from the stream callback,
-- Pa_ReadStream and Pa_WriteStream.
--
-- The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8
-- and aUInt8 are usually implemented by all implementations.
--
-- The floating point representation (paFloat32) uses +1.0 and -1.0 as the
-- maximum and minimum respectively.
--
-- paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
--
-- The paNonInterleaved flag indicates that a multichannel buffer is passed
-- as a set of non-interleaved pointers.
--
-- @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo
-- @see paFloat32, paInt16, paInt32, paInt24, paInt8
-- @see paUInt8, paCustomFormat, paNonInterleaved
--*/
--typedef unsigned long PaSampleFormat;
--
--
--#define paFloat32        ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */
--#define paInt32          ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */
--#define paInt24          ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */
--#define paInt16          ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */
--#define paInt8           ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */
--#define paUInt8          ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */
--#define paCustomFormat   ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */
--
--#define paNonInterleaved ((PaSampleFormat) 0x80000000)
--
--/** A structure providing information and capabilities of PortAudio devices.
-- Devices may support input, output or both input and output.
--*/
--typedef struct PaDeviceInfo
--{
--    int structVersion;  /* this is struct version 2 */
--    const char *name;
--    PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/
--    
--    int maxInputChannels;
--    int maxOutputChannels;
--
--    /* Default latency values for interactive performance. */
--    PaTime defaultLowInputLatency;
--    PaTime defaultLowOutputLatency;
--    /* Default latency values for robust non-interactive applications (eg. playing sound files). */
--    PaTime defaultHighInputLatency;
--    PaTime defaultHighOutputLatency;
--
--    double defaultSampleRate;
--} PaDeviceInfo;
--
--
--/** Retrieve a pointer to a PaDeviceInfo structure containing information
-- about the specified device.
-- @return A pointer to an immutable PaDeviceInfo structure. If the device
-- parameter is out of range the function returns NULL.
--
-- @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
--
-- @note PortAudio manages the memory referenced by the returned pointer,
-- the client must not manipulate or free the memory. The pointer is only
-- guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate().
--
-- @see PaDeviceInfo, PaDeviceIndex
--*/
--const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device );
--
--
--/** Parameters for one direction (input or output) of a stream.
--*/
--typedef struct PaStreamParameters
--{
--    /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
--     specifying the device to be used or the special constant
--     paUseHostApiSpecificDeviceSpecification which indicates that the actual
--     device(s) to use are specified in hostApiSpecificStreamInfo.
--     This field must not be set to paNoDevice.
--    */
--    PaDeviceIndex device;
--    
--    /** The number of channels of sound to be delivered to the
--     stream callback or accessed by Pa_ReadStream() or Pa_WriteStream().
--     It can range from 1 to the value of maxInputChannels in the
--     PaDeviceInfo record for the device specified by the device parameter.
--    */
--    int channelCount;
--
--    /** The sample format of the buffer provided to the stream callback,
--     a_ReadStream() or Pa_WriteStream(). It may be any of the formats described
--     by the PaSampleFormat enumeration.
--    */
--    PaSampleFormat sampleFormat;
--
--    /** The desired latency in seconds. Where practical, implementations should
--     configure their latency based on these parameters, otherwise they may
--     choose the closest viable latency instead. Unless the suggested latency
--     is greater than the absolute upper limit for the device implementations
--     should round the suggestedLatency up to the next practial value - ie to
--     provide an equal or higher latency than suggestedLatency wherever possibe.
--     Actual latency values for an open stream may be retrieved using the
--     inputLatency and outputLatency fields of the PaStreamInfo structure
--     returned by Pa_GetStreamInfo().
--     @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo
--    */
--    PaTime suggestedLatency;
--
--    /** An optional pointer to a host api specific data structure
--     containing additional information for device setup and/or stream processing.
--     hostApiSpecificStreamInfo is never required for correct operation,
--     if not used it should be set to NULL.
--    */
--    void *hostApiSpecificStreamInfo;
--
--} PaStreamParameters;
--
--
--/** Return code for Pa_IsFormatSupported indicating success. */
--#define paFormatIsSupported (0)
--
--/** Determine whether it would be possible to open a stream with the specified
-- parameters.
--
-- @param inputParameters A structure that describes the input parameters used to
-- open a stream. The suggestedLatency field is ignored. See PaStreamParameters
-- for a description of these parameters. inputParameters must be NULL for
-- output-only streams.
--
-- @param outputParameters A structure that describes the output parameters used
-- to open a stream. The suggestedLatency field is ignored. See PaStreamParameters
-- for a description of these parameters. outputParameters must be NULL for
-- input-only streams.
--
-- @param sampleRate The required sampleRate. For full-duplex streams it is the
-- sample rate for both input and output
--
-- @return Returns 0 if the format is supported, and an error code indicating why
-- the format is not supported otherwise. The constant paFormatIsSupported is
-- provided to compare with the return value for success.
--
-- @see paFormatIsSupported, PaStreamParameters
--*/
--PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
--                              const PaStreamParameters *outputParameters,
--                              double sampleRate );
--
--
--
--/* Streaming types and functions */
--
--
--/**
-- A single PaStream can provide multiple channels of real-time
-- streaming audio input and output to a client application. A stream
-- provides access to audio hardware represented by one or more
-- PaDevices. Depending on the underlying Host API, it may be possible 
-- to open multiple streams using the same device, however this behavior 
-- is implementation defined. Portable applications should assume that 
-- a PaDevice may be simultaneously used by at most one PaStream.
--
-- Pointers to PaStream objects are passed between PortAudio functions that
-- operate on streams.
--
-- @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream,
-- Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive,
-- Pa_GetStreamTime, Pa_GetStreamCpuLoad
--
--*/
--typedef void PaStream;
--
--
--/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream()
-- or Pa_OpenDefaultStream() to indicate that the stream callback will
-- accept buffers of any size.
--*/
--#define paFramesPerBufferUnspecified  (0)
--
--
--/** Flags used to control the behavior of a stream. They are passed as
-- parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be
-- ORed together.
--
-- @see Pa_OpenStream, Pa_OpenDefaultStream
-- @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput,
--  paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags
--*/
--typedef unsigned long PaStreamFlags;
--
--/** @see PaStreamFlags */
--#define   paNoFlag          ((PaStreamFlags) 0)
--
--/** Disable default clipping of out of range samples.
-- @see PaStreamFlags
--*/
--#define   paClipOff         ((PaStreamFlags) 0x00000001)
--
--/** Disable default dithering.
-- @see PaStreamFlags
--*/
--#define   paDitherOff       ((PaStreamFlags) 0x00000002)
--
--/** Flag requests that where possible a full duplex stream will not discard
-- overflowed input samples without calling the stream callback. This flag is
-- only valid for full duplex callback streams and only when used in combination
-- with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using
-- this flag incorrectly results in a paInvalidFlag error being returned from
-- Pa_OpenStream and Pa_OpenDefaultStream.
--
-- @see PaStreamFlags, paFramesPerBufferUnspecified
--*/
--#define   paNeverDropInput  ((PaStreamFlags) 0x00000004)
--
--/** Call the stream callback to fill initial output buffers, rather than the
-- default behavior of priming the buffers with zeros (silence). This flag has
-- no effect for input-only and blocking read/write streams.
-- 
-- @see PaStreamFlags
--*/
--#define   paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008)
--
--/** A mask specifying the platform specific bits.
-- @see PaStreamFlags
--*/
--#define   paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000)
--
--/**
-- Timing information for the buffers passed to the stream callback.
--*/
--typedef struct PaStreamCallbackTimeInfo{
--    PaTime inputBufferAdcTime;
--    PaTime currentTime;
--    PaTime outputBufferDacTime;
--} PaStreamCallbackTimeInfo;
--
--
--/**
-- Flag bit constants for the statusFlags to PaStreamCallback.
--
-- @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow,
-- paPrimingOutput
--*/
--typedef unsigned long PaStreamCallbackFlags;
--
--/** In a stream opened with paFramesPerBufferUnspecified, indicates that
-- input data is all silence (zeros) because no real data is available. In a
-- stream opened without paFramesPerBufferUnspecified, it indicates that one or
-- more zero samples have been inserted into the input buffer to compensate
-- for an input underflow.
-- @see PaStreamCallbackFlags
--*/
--#define paInputUnderflow   ((PaStreamCallbackFlags) 0x00000001)
--
--/** In a stream opened with paFramesPerBufferUnspecified, indicates that data
-- prior to the first sample of the input buffer was discarded due to an
-- overflow, possibly because the stream callback is using too much CPU time.
-- Otherwise indicates that data prior to one or more samples in the
-- input buffer was discarded.
-- @see PaStreamCallbackFlags
--*/
--#define paInputOverflow    ((PaStreamCallbackFlags) 0x00000002)
--
--/** Indicates that output data (or a gap) was inserted, possibly because the
-- stream callback is using too much CPU time.
-- @see PaStreamCallbackFlags
--*/
--#define paOutputUnderflow  ((PaStreamCallbackFlags) 0x00000004)
--
--/** Indicates that output data will be discarded because no room is available.
-- @see PaStreamCallbackFlags
--*/
--#define paOutputOverflow   ((PaStreamCallbackFlags) 0x00000008)
--
--/** Some of all of the output data will be used to prime the stream, input
-- data may be zero.
-- @see PaStreamCallbackFlags
--*/
--#define paPrimingOutput    ((PaStreamCallbackFlags) 0x00000010)
--
--/**
-- Allowable return values for the PaStreamCallback.
-- @see PaStreamCallback
--*/
--typedef enum PaStreamCallbackResult
--{
--    paContinue=0,
--    paComplete=1,
--    paAbort=2
--} PaStreamCallbackResult;
--
--
--/**
-- Functions of type PaStreamCallback are implemented by PortAudio clients.
-- They consume, process or generate audio in response to requests from an
-- active PortAudio stream.
--     
-- @param input and @param output are arrays of interleaved samples,
-- the format, packing and number of channels used by the buffers are
-- determined by parameters to Pa_OpenStream().
--     
-- @param frameCount The number of sample frames to be processed by
-- the stream callback.
--
-- @param timeInfo The time in seconds when the first sample of the input
-- buffer was received at the audio input, the time in seconds when the first
-- sample of the output buffer will begin being played at the audio output, and
-- the time in seconds when the stream callback was called.
-- See also Pa_GetStreamTime()
--
-- @param statusFlags Flags indicating whether input and/or output buffers
-- have been inserted or will be dropped to overcome underflow or overflow
-- conditions.
--
-- @param userData The value of a user supplied pointer passed to
-- Pa_OpenStream() intended for storing synthesis data etc.
--
-- @return
-- The stream callback should return one of the values in the
-- PaStreamCallbackResult enumeration. To ensure that the callback continues
-- to be called, it should return paContinue (0). Either paComplete or paAbort
-- can be returned to finish stream processing, after either of these values is
-- returned the callback will not be called again. If paAbort is returned the
-- stream will finish as soon as possible. If paComplete is returned, the stream
-- will continue until all buffers generated by the callback have been played.
-- This may be useful in applications such as soundfile players where a specific
-- duration of output is required. However, it is not necessary to utilise this
-- mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also
-- be used to stop the stream. The callback must always fill the entire output
-- buffer irrespective of its return value.
--
-- @see Pa_OpenStream, Pa_OpenDefaultStream
--
-- @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call
-- PortAudio API functions from within the stream callback.
--*/
--typedef int PaStreamCallback(
--    const void *input, void *output,
--    unsigned long frameCount,
--    const PaStreamCallbackTimeInfo* timeInfo,
--    PaStreamCallbackFlags statusFlags,
--    void *userData );
--
--
--/** Opens a stream for either input, output or both.
--     
-- @param stream The address of a PaStream pointer which will receive
-- a pointer to the newly opened stream.
--     
-- @param inputParameters A structure that describes the input parameters used by
-- the opened stream. See PaStreamParameters for a description of these parameters.
-- inputParameters must be NULL for output-only streams.
--
-- @param outputParameters A structure that describes the output parameters used by
-- the opened stream. See PaStreamParameters for a description of these parameters.
-- outputParameters must be NULL for input-only streams.
-- 
-- @param sampleRate The desired sampleRate. For full-duplex streams it is the
-- sample rate for both input and output
--     
-- @param framesPerBuffer The number of frames passed to the stream callback
-- function, or the preferred block granularity for a blocking read/write stream.
-- The special value paFramesPerBufferUnspecified (0) may be used to request that
-- the stream callback will recieve an optimal (and possibly varying) number of
-- frames based on host requirements and the requested latency settings.
-- Note: With some host APIs, the use of non-zero framesPerBuffer for a callback
-- stream may introduce an additional layer of buffering which could introduce
-- additional latency. PortAudio guarantees that the additional latency
-- will be kept to the theoretical minimum however, it is strongly recommended
-- that a non-zero framesPerBuffer value only be used when your algorithm
-- requires a fixed number of frames per stream callback.
-- 
-- @param streamFlags Flags which modify the behaviour of the streaming process.
-- This parameter may contain a combination of flags ORed together. Some flags may
-- only be relevant to certain buffer formats.
--     
-- @param streamCallback A pointer to a client supplied function that is responsible
-- for processing and filling input and output buffers. If this parameter is NULL
-- the stream will be opened in 'blocking read/write' mode. In blocking mode,
-- the client can receive sample data using Pa_ReadStream and write sample data
-- using Pa_WriteStream, the number of samples that may be read or written
-- without blocking is returned by Pa_GetStreamReadAvailable and
-- Pa_GetStreamWriteAvailable respectively.
--
-- @param userData A client supplied pointer which is passed to the stream callback
-- function. It could for example, contain a pointer to instance data necessary
-- for processing the audio buffers. This parameter is ignored if streamCallback
-- is NULL.
--     
-- @return
-- Upon success Pa_OpenStream() returns paNoError and places a pointer to a
-- valid PaStream in the stream argument. The stream is inactive (stopped).
-- If a call to Pa_OpenStream() fails, a non-zero error code is returned (see
-- PaError for possible error codes) and the value of stream is invalid.
--
-- @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream,
-- Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable
--*/
--PaError Pa_OpenStream( PaStream** stream,
--                       const PaStreamParameters *inputParameters,
--                       const PaStreamParameters *outputParameters,
--                       double sampleRate,
--                       unsigned long framesPerBuffer,
--                       PaStreamFlags streamFlags,
--                       PaStreamCallback *streamCallback,
--                       void *userData );
--
--
--/** A simplified version of Pa_OpenStream() that opens the default input
-- and/or output devices.
--
-- @param stream The address of a PaStream pointer which will receive
-- a pointer to the newly opened stream.
-- 
-- @param numInputChannels  The number of channels of sound that will be supplied
-- to the stream callback or returned by Pa_ReadStream. It can range from 1 to
-- the value of maxInputChannels in the PaDeviceInfo record for the default input
-- device. If 0 the stream is opened as an output-only stream.
--
-- @param numOutputChannels The number of channels of sound to be delivered to the
-- stream callback or passed to Pa_WriteStream. It can range from 1 to the value
-- of maxOutputChannels in the PaDeviceInfo record for the default output dvice.
-- If 0 the stream is opened as an output-only stream.
--
-- @param sampleFormat The sample format of both the input and output buffers
-- provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream.
-- sampleFormat may be any of the formats described by the PaSampleFormat
-- enumeration.
-- 
-- @param sampleRate Same as Pa_OpenStream parameter of the same name.
-- @param framesPerBuffer Same as Pa_OpenStream parameter of the same name.
-- @param streamCallback Same as Pa_OpenStream parameter of the same name.
-- @param userData Same as Pa_OpenStream parameter of the same name.
--
-- @return As for Pa_OpenStream
--
-- @see Pa_OpenStream, PaStreamCallback
--*/
--PaError Pa_OpenDefaultStream( PaStream** stream,
--                              int numInputChannels,
--                              int numOutputChannels,
--                              PaSampleFormat sampleFormat,
--                              double sampleRate,
--                              unsigned long framesPerBuffer,
--                              PaStreamCallback *streamCallback,
--                              void *userData );
--
--
--/** Closes an audio stream. If the audio stream is active it
-- discards any pending buffers as if Pa_AbortStream() had been called.
--*/
--PaError Pa_CloseStream( PaStream *stream );
--
--
--/** Functions of type PaStreamFinishedCallback are implemented by PortAudio 
-- clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback
-- function. Once registered they are called when the stream becomes inactive
-- (ie once a call to Pa_StopStream() will not block).
-- A stream will become inactive after the stream callback returns non-zero,
-- or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio
-- output, if the stream callback returns paComplete, or Pa_StopStream is called,
-- the stream finished callback will not be called until all generated sample data
-- has been played.
-- 
-- @param userData The userData parameter supplied to Pa_OpenStream()
--
-- @see Pa_SetStreamFinishedCallback
--*/
--typedef void PaStreamFinishedCallback( void *userData );
--
--
--/** Register a stream finished callback function which will be called when the 
-- stream becomes inactive. See the description of PaStreamFinishedCallback for 
-- further details about when the callback will be called.
--
-- @param stream a pointer to a PaStream that is in the stopped state - if the
-- stream is not stopped, the stream's finished callback will remain unchanged 
-- and an error code will be returned.
--
-- @param streamFinishedCallback a pointer to a function with the same signature
-- as PaStreamFinishedCallback, that will be called when the stream becomes
-- inactive. Passing NULL for this parameter will un-register a previously
-- registered stream finished callback function.
--
-- @return on success returns paNoError, otherwise an error code indicating the cause
-- of the error.
--
-- @see PaStreamFinishedCallback
--*/
--PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); 
--
--
--/** Commences audio processing.
--*/
--PaError Pa_StartStream( PaStream *stream );
--
--
--/** Terminates audio processing. It waits until all pending
-- audio buffers have been played before it returns.
--*/
--PaError Pa_StopStream( PaStream *stream );
--
--
--/** Terminates audio processing immediately without waiting for pending
-- buffers to complete.
--*/
--PaError Pa_AbortStream( PaStream *stream );
--
--
--/** Determine whether the stream is stopped.
-- A stream is considered to be stopped prior to a successful call to
-- Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream.
-- If a stream callback returns a value other than paContinue the stream is NOT
-- considered to be stopped.
--
-- @return Returns one (1) when the stream is stopped, zero (0) when
-- the stream is running or, a PaErrorCode (which are always negative) if
-- PortAudio is not initialized or an error is encountered.
--
-- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive
--*/
--PaError Pa_IsStreamStopped( PaStream *stream );
--
--
--/** Determine whether the stream is active.
-- A stream is active after a successful call to Pa_StartStream(), until it
-- becomes inactive either as a result of a call to Pa_StopStream() or
-- Pa_AbortStream(), or as a result of a return value other than paContinue from
-- the stream callback. In the latter case, the stream is considered inactive
-- after the last buffer has finished playing.
--
-- @return Returns one (1) when the stream is active (ie playing or recording
-- audio), zero (0) when not playing or, a PaErrorCode (which are always negative)
-- if PortAudio is not initialized or an error is encountered.
--
-- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped
--*/
--PaError Pa_IsStreamActive( PaStream *stream );
--
--
--
--/** A structure containing unchanging information about an open stream.
-- @see Pa_GetStreamInfo
--*/
--
--typedef struct PaStreamInfo
--{
--    /** this is struct version 1 */
--    int structVersion;
--
--    /** The input latency of the stream in seconds. This value provides the most
--     accurate estimate of input latency available to the implementation. It may
--     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
--     The value of this field will be zero (0.) for output-only streams.
--     @see PaTime
--    */
--    PaTime inputLatency;
--
--    /** The output latency of the stream in seconds. This value provides the most
--     accurate estimate of output latency available to the implementation. It may
--     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
--     The value of this field will be zero (0.) for input-only streams.
--     @see PaTime
--    */
--    PaTime outputLatency;
--
--    /** The sample rate of the stream in Hertz (samples per second). In cases
--     where the hardware sample rate is inaccurate and PortAudio is aware of it,
--     the value of this field may be different from the sampleRate parameter
--     passed to Pa_OpenStream(). If information about the actual hardware sample
--     rate is not available, this field will have the same value as the sampleRate
--     parameter passed to Pa_OpenStream().
--    */
--    double sampleRate;
--    
--} PaStreamInfo;
--
--
--/** Retrieve a pointer to a PaStreamInfo structure containing information
-- about the specified stream.
-- @return A pointer to an immutable PaStreamInfo structure. If the stream
-- parameter invalid, or an error is encountered, the function returns NULL.
--
-- @param stream A pointer to an open stream previously created with Pa_OpenStream.
--
-- @note PortAudio manages the memory referenced by the returned pointer,
-- the client must not manipulate or free the memory. The pointer is only
-- guaranteed to be valid until the specified stream is closed.
--
-- @see PaStreamInfo
--*/
--const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream );
--
--
--/** Determine the current time for the stream according to the same clock used
-- to generate buffer timestamps. This time may be used for syncronising other
-- events to the audio stream, for example synchronizing audio to MIDI.
--                                        
-- @return The stream's current time in seconds, or 0 if an error occurred.
--
-- @see PaTime, PaStreamCallback
--*/
--PaTime Pa_GetStreamTime( PaStream *stream );
--
--
--/** Retrieve CPU usage information for the specified stream.
-- The "CPU Load" is a fraction of total CPU time consumed by a callback stream's
-- audio processing routines including, but not limited to the client supplied
-- stream callback. This function does not work with blocking read/write streams.
--
-- This function may be called from the stream callback function or the
-- application.
--     
-- @return
-- A floating point value, typically between 0.0 and 1.0, where 1.0 indicates
-- that the stream callback is consuming the maximum number of CPU cycles possible
-- to maintain real-time operation. A value of 0.5 would imply that PortAudio and
-- the stream callback was consuming roughly 50% of the available CPU time. The
-- return value may exceed 1.0. A value of 0.0 will always be returned for a
-- blocking read/write stream, or if an error occurrs.
--*/
--double Pa_GetStreamCpuLoad( PaStream* stream );
--
--
--/** Read samples from an input stream. The function doesn't return until
-- the entire buffer has been filled - this may involve waiting for the operating
-- system to supply the data.
--
-- @param stream A pointer to an open stream previously created with Pa_OpenStream.
-- 
-- @param buffer A pointer to a buffer of sample frames. The buffer contains
-- samples in the format specified by the inputParameters->sampleFormat field
-- used to open the stream, and the number of channels specified by
-- inputParameters->numChannels. If non-interleaved samples were requested,
-- buffer is a pointer to the first element of an array of non-interleaved
-- buffer pointers, one for each channel.
--
-- @param frames The number of frames to be read into buffer. This parameter
-- is not constrained to a specific range, however high performance applications
-- will want to match this parameter to the framesPerBuffer parameter used
-- when opening the stream.
--
-- @return On success PaNoError will be returned, or PaInputOverflowed if input
-- data was discarded by PortAudio after the previous call and before this call.
--*/
--PaError Pa_ReadStream( PaStream* stream,
--                       void *buffer,
--                       unsigned long frames );
--
--
--/** Write samples to an output stream. This function doesn't return until the
-- entire buffer has been consumed - this may involve waiting for the operating
-- system to consume the data.
--
-- @param stream A pointer to an open stream previously created with Pa_OpenStream.
--
-- @param buffer A pointer to a buffer of sample frames. The buffer contains
-- samples in the format specified by the outputParameters->sampleFormat field
-- used to open the stream, and the number of channels specified by
-- outputParameters->numChannels. If non-interleaved samples were requested,
-- buffer is a pointer to the first element of an array of non-interleaved
-- buffer pointers, one for each channel.
--
-- @param frames The number of frames to be written from buffer. This parameter
-- is not constrained to a specific range, however high performance applications
-- will want to match this parameter to the framesPerBuffer parameter used
-- when opening the stream.
--
-- @return On success PaNoError will be returned, or paOutputUnderflowed if
-- additional output data was inserted after the previous call and before this
-- call.
--*/
--PaError Pa_WriteStream( PaStream* stream,
--                        const void *buffer,
--                        unsigned long frames );
--
--
--/** Retrieve the number of frames that can be read from the stream without
-- waiting.
--
-- @return Returns a non-negative value representing the maximum number of frames
-- that can be read from the stream without blocking or busy waiting or, a
-- PaErrorCode (which are always negative) if PortAudio is not initialized or an
-- error is encountered.
--*/
--signed long Pa_GetStreamReadAvailable( PaStream* stream );
--
--
--/** Retrieve the number of frames that can be written to the stream without
-- waiting.
--
-- @return Returns a non-negative value representing the maximum number of frames
-- that can be written to the stream without blocking or busy waiting or, a
-- PaErrorCode (which are always negative) if PortAudio is not initialized or an
-- error is encountered.
--*/
--signed long Pa_GetStreamWriteAvailable( PaStream* stream );
--
--
--/* Miscellaneous utilities */
--
--
--/** Retrieve the size of a given sample format in bytes.
--
-- @return The size in bytes of a single sample in the specified format,
-- or paSampleFormatNotSupported if the format is not supported.
--*/
--PaError Pa_GetSampleSize( PaSampleFormat format );
--
--
--/** Put the caller to sleep for at least 'msec' milliseconds. This function is
-- provided only as a convenience for authors of portable code (such as the tests
-- and examples in the PortAudio distribution.)
--
-- The function may sleep longer than requested so don't rely on this for accurate
-- musical timing.
--*/
--void Pa_Sleep( long msec );
--
--
--
--#ifdef __cplusplus
--}
--#endif /* __cplusplus */
--#endif /* PORTAUDIO_H */
---- a/src/wave.cpp
-+++ b/src/wave.cpp
-@@ -31,7 +31,10 @@
- #include <sys/time.h>
- #include <time.h>
--#include "portaudio.h"
-+#ifdef USE_PORTAUDIO
-+#include <portaudio.h>
-+#endif
-+
- #ifdef PLATFORM_WINDOWS
- #include <windows.h>
- #else
---- a/src/wavegen.cpp
-+++ b/src/wavegen.cpp
-@@ -40,7 +40,7 @@
- #endif
- #ifdef USE_PORTAUDIO
--#include "portaudio.h"
-+#include <portaudio.h>
- #undef USE_PORTAUDIO
- // determine portaudio version by looking for a #define which is not in V18
- #ifdef paNeverDropInput
index 40d99d79b1003d94099ac5cbc3bf53407a765638..64eddbe226c59773dac7f84ed24c0ac5935ae1b5 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=portaudio
-PKG_VERSION:=19_20140130
-PKG_RELEASE:=2
+PKG_VERSION:=190600_20161030
+PKG_RELEASE:=1
 
 PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://www.portaudio.com/archives/
-PKG_HASH:=8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57
+PKG_HASH:=f5a21d7dcd6ee84397446fa1fa1a0675bb2e8a4a6dceb4305a8404698d8d1513
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE.txt
index 17a2d721b9744269b02664c4991880fe8f77da20..563665590f23511eb08e27eb89af8c030c309c10 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=at
-PKG_VERSION:=3.1.20
+PKG_VERSION:=3.1.23
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
-PKG_HASH:=0871923cab73050b98ace020664eb2ddc1e669e4166b5abb64d864d02fcefab9
+PKG_HASH:=97450aa954aaa8a70218cc8e61a33df9fee9f86527e9f861de302fb7a3c81710
 
 PKG_LICENSE:=GPL-2.0+ GPL-3.0+ ISC
 PKG_LICENSE_FILES:=COPYING Copyright
index 6ae0d415358c926e3b2cf2bf0fa9c4626a4ab466..b7b72f5c79f5a7d977875c99f2b45348036cbc8c 100644 (file)
@@ -8,17 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bonnie++
-PKG_VERSION:=1.97
+PKG_VERSION:=1.97.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/
-PKG_HASH:=44f5a05937648a6526ba99354555d7d15f2dd392e55d3436f6746da6f6c35982
+PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/
+PKG_HASH:=e27b386ae0dc054fa7b530aab6bdead7aea6337a864d1f982bc9ebacb320746e
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=copyright.txt
 PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
index 0379fec0bd6e1ead82aa3ee7d03a7ca13cdcf6b9..e3ff56b121b5e28e5dccfbc8f7b6875c09981340 100644 (file)
@@ -1,7 +1,7 @@
-Index: bonnie++-1.97.1/configure
+Index: bonnie++-1.97.3/configure
 ===================================================================
---- bonnie++-1.97.1.orig/configure
-+++ bonnie++-1.97.1/configure
+--- bonnie++-1.97.3.orig/configure
++++ bonnie++-1.97.3/configure
 @@ -3955,9 +3955,7 @@ rm -f core conftest.err conftest.$ac_obj
  
  if test "$cross_compiling" = yes; then :
@@ -13,10 +13,10 @@ Index: bonnie++-1.97.1/configure
  else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
-Index: bonnie++-1.97.1/Makefile
+Index: bonnie++-1.97.3/Makefile
 ===================================================================
---- bonnie++-1.97.1.orig/Makefile
-+++ bonnie++-1.97.1/Makefile
+--- bonnie++-1.97.3.orig/Makefile
++++ bonnie++-1.97.3/Makefile
 @@ -1,5 +1,7 @@
  EXES=bonnie++ zcav getc_putc getc_putc_helper
  EXE=bon_csv2html generate_randfile
index 29ad43e0cf8e8921eebb3187f55d6a16b9ddb3de..8c0cf79289dd251d9b6eddb58347e932b7d11264 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=crelay
-PKG_VERSION:=0.12
+PKG_VERSION:=0.13
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ondrej1024/crelay/tar.gz/V$(PKG_VERSION)?
-PKG_HASH:=84b2523107bb3e7263d0be1c3c367de1956b41711293e108f4ce483f5e66913f
+PKG_HASH:=d9919fe91e8641352f0b4705a37acc7ba4b3c4286ca78a629968f16f343cfdc4
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=GPL-2.0
index bf61564d87ccf9e8c7e88af0e19f735a79a00943..c7e282e37f0d73dadb38e805b69781e48bcfd36f 100644 (file)
@@ -8,15 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fio
-PKG_VERSION:=3.8
+PKG_VERSION:=3.10
 PKG_RELEASE:=1
-PKG_MAINTAINER:=Dragan Stancevic <ds@codeminutia.com>
-PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE_URL:=http://brick.kernel.dk/snaps
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=7868c4332aab98b88b7ebbb3ecfebc86cbc68b74ac0104575fa4f66bb7874a0e
+PKG_HASH:=21150f1ac0b8d70f1b435a090221305b4e89ea17db3a313274d96b90b40dafcf
+
+PKG_MAINTAINER:=Dragan Stancevic <ds@codeminutia.com>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -42,6 +43,7 @@ CONFIGURE_ARGS = \
        --disable-numa \
        --disable-rdma \
        --disable-rados \
+       --disable-http \
        --disable-rbd \
        --disable-gfapi \
        --disable-lex \
diff --git a/utils/fish/Makefile b/utils/fish/Makefile
new file mode 100644 (file)
index 0000000..4c4e108
--- /dev/null
@@ -0,0 +1,67 @@
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fish
+PKG_VERSION:=2.7.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/fish-shell/fish-shell/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=eb43ea2eb9accf76661c487dd530a5fd345fa40a3201bd22cef2c52be39fb474
+PKG_MAINTAINER:=Curtis Jiang <jqqqqqqqqqq@gmail.com>
+PKG_LICENSE:=GPL-2.0
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/fish-shell-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fish
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Shells
+  TITLE:=A smart and user-friendly command line shell
+  DEPENDS:=+libncurses +libstdcpp +librt
+  URL:=https://fishshell.com
+endef
+
+define Package/fish/description
+  Fish is a smart and user-friendly command line shell for OS X, Linux, and the
+  rest of the family. Fish includes features like syntax highlighting,
+  autosuggest-as-you-type, and fancy tab completions that just work, with no
+  configuration required.
+endef
+
+CONFIGURE_VARS += ac_cv_file__proc_self_stat=yes
+TARGET_CXXFLAGS += -std=c++0x
+
+define Package/fish/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fish $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/share/fish
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/fish/* $(1)/usr/share/fish/
+       rm -rf $(1)/usr/share/fish/groff
+       rm -rf $(1)/usr/share/fish/man
+       rm -rf $(1)/usr/share/fish/tools
+endef
+
+define Package/fish/postinst
+#!/bin/sh
+grep fish $${IPKG_INSTROOT}/etc/shells || \
+    echo "/usr/bin/fish" >> $${IPKG_INSTROOT}/etc/shells
+
+    # Backwards compatibility
+    if [[ -e /bin/fish ]] && ([[ ! -L /bin/fish ]] || [[ "$(readlink -fn $${IPKG_INSTROOT}/bin/fish)" != "../$(CONFIGURE_PREFIX)/bin/fish" ]]); then
+        ln -fs "../$(CONFIGURE_PREFIX)/bin/fish" "$${IPKG_INSTROOT}/bin/fish"
+    fi
+endef
+
+define Package/fish/postrm
+       rm -rf "$${IPKG_INSTROOT}/$(CONFIGURE_PREFIX)/share/fish/$(PKG_VERSION)"
+endef
+
+$(eval $(call BuildPackage,fish))
diff --git a/utils/fish/patches/001-no-hostname-and-whoami.patch b/utils/fish/patches/001-no-hostname-and-whoami.patch
new file mode 100644 (file)
index 0000000..c530734
--- /dev/null
@@ -0,0 +1,54 @@
+diff --git a/share/functions/prompt_hostname.fish b/share/functions/prompt_hostname.fish
+index 4348bce2..8502ce3f 100644
+--- a/share/functions/prompt_hostname.fish
++++ b/share/functions/prompt_hostname.fish
+@@ -2,7 +2,7 @@
+ # hostname command uses. So cache the answer so including it in the prompt doesn't make fish seem
+ # slow.
+ if not set -q __fish_prompt_hostname
+-    set -g __fish_prompt_hostname (hostname | string split '.')[1]
++    set -g __fish_prompt_hostname (uname -n | string split '.')[1]
+ end
+ function prompt_hostname
+diff --git a/share/tools/web_config/sample_prompts/pythonista.fish b/share/tools/web_config/sample_prompts/pythonista.fish
+index 9529035c..57ffaf86 100644
+--- a/share/tools/web_config/sample_prompts/pythonista.fish
++++ b/share/tools/web_config/sample_prompts/pythonista.fish
+@@ -7,7 +7,7 @@ function fish_prompt
+         set -g VIRTUAL_ENV_DISABLE_PROMPT true
+     end
+     set_color yellow
+-    printf '%s' (whoami)
++    printf '%s' (id -un)
+     set_color normal
+     printf ' at '
+diff --git a/share/tools/web_config/sample_prompts/screen_savvy.fish b/share/tools/web_config/sample_prompts/screen_savvy.fish
+index 411a5501..5cdcfb69 100644
+--- a/share/tools/web_config/sample_prompts/screen_savvy.fish
++++ b/share/tools/web_config/sample_prompts/screen_savvy.fish
+@@ -2,8 +2,8 @@
+ # author: Matthias
+ function fish_prompt -d "Write out the prompt"
+     if test -z $WINDOW
+-        printf '%s%s@%s%s%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
++        printf '%s%s@%s%s%s%s%s> ' (set_color yellow) (id -un) (set_color purple) (prompt_hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
+     else
+-        printf '%s%s@%s%s%s(%s)%s%s%s> ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color white) (echo $WINDOW) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
++        printf '%s%s@%s%s%s(%s)%s%s%s> ' (set_color yellow) (id -un) (set_color purple) (prompt_hostname) (set_color white) (echo $WINDOW) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
+     end
+ end
+diff --git a/share/tools/web_config/sample_prompts/terlar.fish b/share/tools/web_config/sample_prompts/terlar.fish
+index d49ef340..59b3d267 100644
+--- a/share/tools/web_config/sample_prompts/terlar.fish
++++ b/share/tools/web_config/sample_prompts/terlar.fish
+@@ -6,7 +6,7 @@ function fish_prompt --description 'Write out the prompt'
+     # User
+     set_color $fish_color_user
+-    echo -n (whoami)
++    echo -n (id -un)
+     set_color normal
+     echo -n '@'
diff --git a/utils/hplip/Makefile b/utils/hplip/Makefile
new file mode 100644 (file)
index 0000000..6c1c853
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2017-2018 Luiz Angelo Daros de Luca <luizluca@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hplip
+PKG_VERSION:=3.18.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/hplip
+PKG_HASH:=0ecf3e68b09480f602de81798ac00774cf8ffe754692e784bbbe0f9b2e337b7d
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
+PKG_LICENSE:=GPL-2.0 GPL-2.0+
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+PKG_BUILD_DEPENDS := python libcups
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hplip/Default
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=HP Linux Imaging and Printing
+  URL:=http://sourceforge.net/projects/hplip/
+endef
+
+define Package/hplip/Default/description
+       HPLIP is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.
+endef
+
+define Package/hplip-common
+$(call Package/hplip/Default)
+  TITLE+= (common files)
+  DEPENDS+=+libusb-1.0
+endef
+
+define Package/hplip-common/description
+$(call Package/hplip/Default/description)
+
+These are common files shared between subpackages
+endef
+
+define Package/hplip-sane
+$(call Package/hplip/Default)
+  TITLE+= (scanner drivers)
+  DEPENDS+=+libsane +hplip-common
+endef
+
+define Package/hplip-sane/description
+$(call Package/hplip/Default/description)
+
+S.A.N.E backend for HP Scanners
+endef
+
+CONFIGURE_ARGS += \
+       --disable-gui-build \
+       --disable-network-build \
+       --disable-fax-build \
+       --disable-pp-build \
+       --disable-doc-build \
+       --disable-dbus-build \
+       --enable-lite-build
+
+define Package/hplip-common/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/.libs/libhpip.so* $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/.libs/libhpmud.so* $(1)/usr/lib/
+
+       $(INSTALL_DIR) $(1)/etc/hp
+       $(CP) $(PKG_BUILD_DIR)/hplip.conf $(1)/etc/hp/hplip.conf
+
+       $(INSTALL_DIR) $(1)/usr/share/hplip/data/models/
+       $(CP) $(PKG_BUILD_DIR)/data/models/models.dat $(1)/usr/share/hplip/data/models/
+
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/usb/
+       $(INSTALL_BIN) ./files/20-hplip $(1)/etc/hotplug.d/usb/
+endef
+
+define Package/hplip-sane/install
+       $(INSTALL_DIR) $(1)/usr/lib/sane
+       $(CP) $(PKG_BUILD_DIR)/.libs/libsane-hpaio.so* $(1)/usr/lib/sane
+
+       $(INSTALL_DIR) $(1)/etc/sane.d/dll.d/
+       $(INSTALL_DATA) ./files/hplib.conf $(1)/etc/sane.d/dll.d/hplib
+endef
+
+define Package/hplip-common/conffiles
+/etc/hp/hplip.conf
+endef
+
+define Package/hplip-sane/conffiles
+/etc/sane.d/dll.d/hplib
+endef
+
+$(eval $(call BuildPackage,hplip-common))
+$(eval $(call BuildPackage,hplip-sane))
diff --git a/utils/hplip/files/20-hplip b/utils/hplip/files/20-hplip
new file mode 100644 (file)
index 0000000..6066cc5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Copyright (C) 2009 OpenWrt.org
+
+
+case "$ACTION" in
+        add)
+                # You have to figure out your PRODUCT id. Uncomment the line below,
+                # attach and detach your HP USB printer to find your id in /tmp/hplip.test.
+                # It will look like "Found 3f0/1717/100 on /proc/bus/usb/002/009"
+                # Replace 3f0/1717/100 below with your id.
+                #
+                # echo "Found $PRODUCT on $DEVICE" > /tmp/hplip.test
+
+                [ "$PRODUCT" = "3f0/1717/100" ] && chown nobody $DEVICE && chmod 666 $DEVICE
+                ;;
+        remove)
+                # device is gone
+                ;;
+esac
diff --git a/utils/hplip/files/hplib.conf b/utils/hplip/files/hplib.conf
new file mode 100644 (file)
index 0000000..d67d370
--- /dev/null
@@ -0,0 +1,2 @@
+# Load the hplib driver
+hpaio
diff --git a/utils/hplip/patches/010-libusb_fix.patch b/utils/hplip/patches/010-libusb_fix.patch
new file mode 100644 (file)
index 0000000..0045139
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/configure.in
++++ b/configure.in
+@@ -595,6 +595,10 @@ if test "$class_driver" = "no" && test "
+    else
+       AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
+       AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
++      PKG_CHECK_MODULES(LIBUSB_1_0, [ libusb-1.0 >= 1.0.0 ], have_libusb_1_0=yes, have_libusb_1_0=no)
++      if test "$have_libusb_1_0" = "yes"; then
++        CFLAGS="$CFLAGS $LIBUSB_1_0_CFLAGS"
++      fi
+    fi
+ fi
diff --git a/utils/hplip/patches/020-remove_cups_dep_on_scan.patch b/utils/hplip/patches/020-remove_cups_dep_on_scan.patch
new file mode 100644 (file)
index 0000000..bbeb0dc
--- /dev/null
@@ -0,0 +1,163 @@
+--- a/scan/sane/hpaio.c
++++ b/scan/sane/hpaio.c
+@@ -34,7 +34,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <cups/cups.h>
+ #include "hpmud.h"
+ #include "hpip.h"
+ #include "hp_ipp.h"
+@@ -144,98 +143,6 @@ static int GetUriLine(char *buf, char *u
+    return i;
+ }
+-static int AddCupsList(char *uri, char ***printer)
+-{
+-   int i, stat=1;
+-
+-   /* Look for hp network URIs only. */
+-   if (strncasecmp(uri, "hp:/net/", 8) !=0)
+-      goto bugout;
+-
+-   if (*printer == NULL)
+-   {
+-      /* Allocate array of string pointers. */
+-      *printer = malloc(sizeof(char *) * MAX_DEVICE);
+-      memset(*printer, 0, sizeof(char *) * MAX_DEVICE);
+-   }
+-
+-   /* Ignor duplicates (ie: printer queues using the same device). */
+-   for (i=0; (*printer)[i] != NULL && i<MAX_DEVICE; i++)
+-   {
+-      if (strcmp((*printer)[i], uri) == 0)
+-         goto bugout;
+-   }
+-
+-   /* Find empty slot in array of pointers. */
+-   for (i=0; i<MAX_DEVICE; i++)
+-   {
+-      if ((*printer)[i] == NULL)
+-      {
+-         (*printer)[i] = strdup(uri);
+-         break;
+-      }
+-   }
+-
+-   stat = 0;
+-
+-bugout:
+-
+-   return stat;
+-}
+-
+-
+-static int GetCupsPrinters(char ***printer)
+-{
+-   http_t *http=NULL;     /* HTTP object */
+-   ipp_t *request=NULL;  /* IPP request object */
+-   ipp_t *response=NULL; /* IPP response object */
+-   ipp_attribute_t *attr;     /* Current IPP attribute */
+-   int cnt=0;
+-
+-   /* Connect to the HTTP server */
+-   if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL)
+-      goto bugout;
+-
+-   /* Assemble the IPP request */
+-   request = ippNew();
+-
+-   ippSetOperation( request, CUPS_GET_PRINTERS );
+-   ippSetRequestId( request, 1 );
+-
+-   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
+-   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
+-   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "device-uri");
+-
+-   /* Send the request and get a response. */
+-   if ((response = cupsDoRequest(http, request, "/")) == NULL)
+-      goto bugout;
+-
+-   for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
+-   {
+-      /* Skip leading attributes until we hit a printer. */
+-      while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
+-         attr = ippNextAttribute( response );
+-
+-      if (attr == NULL)
+-         break;
+-
+-      while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
+-      {
+-         if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
+-            cnt++;
+-         attr = ippNextAttribute( response );
+-      }
+-
+-      if (attr == NULL)
+-         break;
+-   }
+-
+-   ippDelete(response);
+-
+- bugout:
+-   return cnt;
+-}
+-
+ static int AddDevice(char *uri)
+ {
+     struct hpmud_model_attributes ma;
+@@ -264,7 +171,6 @@ static int DevDiscovery(int localOnly)
+     char uri[HPMUD_LINE_SIZE];
+     char *tail = message;
+     int i, scan_type, cnt=0, total=0, bytes_read;
+-    char **cups_printer=NULL;     /* list of printers */
+     char* token = NULL;
+     enum HPMUD_RESULT stat;
+@@ -279,34 +185,6 @@ static int DevDiscovery(int localOnly)
+         total += AddDevice(uri);
+     }
+-    /* Look for Network Scan devices if localonly flag if FALSE. */
+-    if (!localOnly)
+-    {
+-        /* Look for all-in-one scan devices for which print queue created */
+-        cnt = GetCupsPrinters(&cups_printer);
+-        for (i=0; i<cnt; i++)
+-        {
+-            total += AddDevice(cups_printer[i]);
+-            free(cups_printer[i]);
+-        }
+-        if (cups_printer)
+-            free(cups_printer);
+-#ifdef HAVE_LIBNETSNMP
+-        /* Discover NW scanners using Bonjour*/
+-        bytes_read = mdns_probe_nw_scanners(message, sizeof(message), &cnt);
+-        token = strtok(message, ";");
+-        while (token)
+-        {
+-            total += AddDevice(token);
+-            token = strtok(NULL, ";");
+-        }
+-#endif
+-        if(!total)
+-        {          
+-          SendScanEvent("hpaio:/net/HP_Scan_Devices?ip=1.1.1.1", EVENT_ERROR_NO_PROBED_DEVICES_FOUND);
+-        }
+-    }
+-
+ bugout:
+    return total;
+ }
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -67,7 +67,7 @@ else
+ libsane_hpaio_la_LDFLAGS = -version-info 1:0:0
+ endif
+ # The following is a interlibrary dependency that must be compiled first.
+-libsane_hpaio_la_LIBADD = libhpip.la libhpmud.la libhpipp.la $(DBUS_LIBS) -lcups -ldl
++libsane_hpaio_la_LIBADD = libhpip.la libhpmud.la libhpipp.la $(DBUS_LIBS) -ldl
+ #libsane_hpaio_la_CFLAGS = -DWITH_NONAMESPACES -DSOAP_DEBUG
+ libsane_hpaio_la_CFLAGS = $(DBUS_CFLAGS) -Iprotocol
diff --git a/utils/hplip/patches/030-replace_unsafe_memcpy_with_memmove.patch b/utils/hplip/patches/030-replace_unsafe_memcpy_with_memmove.patch
new file mode 100644 (file)
index 0000000..2babb2b
--- /dev/null
@@ -0,0 +1,15 @@
+https://bugs.launchpad.net/hplip/+bug/1672256
+
+memcpy should never be used with overlapping memory regions
+
+--- a/io/hpmud/musb.c
++++ b/io/hpmud/musb.c
+@@ -775,7 +775,7 @@ static int device_id(int fd, unsigned ch
+         len = size-1;   /* leave byte for zero termination */
+     if (len > 2)
+         len -= 2;
+-    memcpy(buffer, buffer+2, len);    /* remove length */
++    memmove(buffer, buffer+2, len);    /* remove length */
+     buffer[len]=0;
+     DBG("read actual device_id successfully fd=%d len=%d\n", fd, len);
diff --git a/utils/hplip/patches/040-fix_bool.patch b/utils/hplip/patches/040-fix_bool.patch
new file mode 100644 (file)
index 0000000..2f43429
--- /dev/null
@@ -0,0 +1,31 @@
+https://bugs.launchpad.net/hplip/+bug/1778626
+
+--- a/prnt/hpcups/genPCLm.cpp
++++ b/prnt/hpcups/genPCLm.cpp
+@@ -171,7 +171,7 @@ Defines
+ #define rgb_2_gray(r,g,b) (ubyte)(0.299*(double)r+0.587*(double)g+0.114*(double)b)
+ // Note: this is required for debugging
+-boolean writeOutputFile(int numBytes, ubyte *ptr, char *user_name);
++bool writeOutputFile(int numBytes, ubyte *ptr, char *user_name);
+ /* 
+ ********************************************* Helper Routines **************************
+@@ -343,7 +343,7 @@ bool PCLmGenerator::addKids(sint32 kidOb
+       return(true);
+ }
+-boolean writeOutputFile(int numBytes, ubyte *ptr, char *user_name)
++bool writeOutputFile(int numBytes, ubyte *ptr, char *user_name)
+ {
+       FILE *outputFile;
+       char outFileName[MAX_FILE_PATH_LEN];
+@@ -1074,7 +1074,7 @@ void PCLmGenerator::writePDFGrammarPage(
+ * Limitations:
+ *   - 
+ *****************************************************************************************/
+-boolean prepImageForBacksideDuplex(ubyte *imagePtr, sint32 imageHeight, sint32 imageWidth, sint32 numComponents)
++bool prepImageForBacksideDuplex(ubyte *imagePtr, sint32 imageHeight, sint32 imageWidth, sint32 numComponents)
+ {
+       sint32 numBytes=imageHeight*imageWidth*numComponents;
+       ubyte *head, *tail, t0, t1, t2; 
index 5db0de7470c395f0e4cb29917218af29c5ed3edb..9b334f13cc2412e1827a0c080f85dfd762e3d0e6 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=less
-PKG_VERSION:=487
+PKG_VERSION:=530
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less
-PKG_HASH:=f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706
+PKG_HASH:=503f91ab0af4846f34f0444ab71c4b286123f0044a4964f1ae781486c617f2e2
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
index b2c57941b187f2a9c20714ae98b45c2901c6c75e..fcd8fad33fea3625c341f0e84cff35799fb647e7 100644 (file)
@@ -49,11 +49,11 @@ config MC_CHARSET
 
 config MC_VFS
        bool "Enable virtual filesystem support"
-       default n
+       default y
        help
            This option enables the Virtual File System switch code to get
            transparent access to the following file systems:
-           cpio, tar, fish, sfs, ftp, sftp, extfs, smb.
-           Disabled by default.
+           cpio, tar, fish, sfs, ftp, sftp, extfs.
+           Enabled by default.
 
 endmenu
index ab3ae2b6813fa3a8bcb0fae8f91a20fe8df9807a..51384798c398d37918932120721cb56d8d67561b 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mc
 PKG_VERSION:=4.8.21
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 PKG_LICENSE:=GPL-3.0+
 
@@ -58,7 +58,6 @@ CONFIGURE_ARGS += \
        --disable-doxygen-doc \
        --with-homedir=/etc/mc \
        --with-screen=ncurses \
-       --without-gpm-mouse \
        --without-x \
 
 CONFIGURE_VARS += \
index 62c78a7563f707d7f383b85a589130c6af360166..c52e5803ab9b752c36513cc179610afbae6142e6 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=2.9.8
+PKG_VERSION:=3.1
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
-PKG_HASH:=c2deac31ba4d3fd27a42fafcc47ccf499296cc69a422bbecab63f2933ea85488
+PKG_HASH:=14c02ca40a5bc61c580ce2f9cb7f9fc72d5ccc9da17ad044f78f6fb3fdb7719e
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
diff --git a/utils/nano/patches/001-upstream-fix-for-3.1-tiny-compilation.patch b/utils/nano/patches/001-upstream-fix-for-3.1-tiny-compilation.patch
new file mode 100644 (file)
index 0000000..58fe198
--- /dev/null
@@ -0,0 +1,29 @@
+From 368ec04870a366b19f1c5801a6868786547968b0 Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <bensberg@telfort.nl>
+Date: Wed, 19 Sep 2018 20:36:39 +0200
+Subject: build: fix compilation again when configured with --enable-tiny
+
+Reported-by: Jordi Mallach <jordi@mallach.net>
+---
+ src/nano.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/nano.c b/src/nano.c
+index ebb1f11..01f92a1 100644
+--- a/src/nano.c
++++ b/src/nano.c
+@@ -1756,7 +1756,10 @@ int do_input(bool allow_funcs)
+       if (shortcut == NULL)
+               pletion_line = NULL;
+       else {
+-              if (ISSET(VIEW_MODE) && shortcut->func != do_toggle_void &&
++              if (ISSET(VIEW_MODE) &&
++#ifndef NANO_TINY
++                                                              shortcut->func != do_toggle_void &&
++#endif
+                                                               !okay_for_view(shortcut)) {
+                       print_view_warning();
+                       return ERR;
+-- 
+cgit v1.0-41-gc330
+
index e029097c5658adc99350f06b8e6c65f622fdf13a..21efa69135ea5269e3db0b3627127ac8b99bbd39 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ttyd
-PKG_VERSION:=1.4.0
+PKG_VERSION:=1.4.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.github.com/tsl0922/ttyd/tar.gz/$(PKG_VERSION)?
 PKG_SOURCE_VERSION=$(PKG_VERSION)
-PKG_HASH=757a9b5b5dd3de801d7db8fab6035d97ea144b02a51c78bdab28a8e07bcf05d6
+PKG_HASH=ff1a66b418df6cd741868a8ea84f69cd63f15e52e3fa117641ec57d3c37a1315
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
index a6827e207df2d0b464bdbdc6cf0a3b9a79407654..24dbc9c736b576e92263690594c216dbd20db326 100644 (file)
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE_URL:=https://codeload.github.com/arduino/YunBridge/tar.gz/$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_HASH:=9e5ffc7a0d0cc2c92e972e425adcc49b77cf39da075d31728e7755d316d910d8
-PKG_BUILD_DIR:=YunBridge-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/YunBridge-$(PKG_VERSION)
 
 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
 PKG_LICENSE:=GPL-2.0
index c358ea56f550de1a5c24f4e53f59e6753ccb9e54..5734159dde91ef2ea0b9852f8b40ad5da7a604f8 100644 (file)
@@ -100,6 +100,24 @@ $(call Package/zoneinfo/Default)
   TITLE:=Zone Information (India)
 endef
 
+define Package/zoneinfo-all
+$(call Package/zoneinfo/Default)
+  TITLE:=Zone Information (all zones)
+  DEPENDS:= \
+       +zoneinfo-simple \
+       +zoneinfo-core \
+       +zoneinfo-africa \
+       +zoneinfo-northamerica \
+       +zoneinfo-southamerica \
+       +zoneinfo-poles \
+       +zoneinfo-asia \
+       +zoneinfo-atlantic \
+       +zoneinfo-australia-nz \
+       +zoneinfo-pacific \
+       +zoneinfo-europe \
+       +zoneinfo-india
+endef
+
 define Build/Prepare
        (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE))
 endef
@@ -240,3 +258,4 @@ $(eval $(call BuildPackage,zoneinfo-australia-nz))
 $(eval $(call BuildPackage,zoneinfo-pacific))
 $(eval $(call BuildPackage,zoneinfo-europe))
 $(eval $(call BuildPackage,zoneinfo-india))
+$(eval $(call BuildPackage,zoneinfo-all))
index 5fce535468aa8db20979f73211cbe19e88777c25..33cf3077c55190422670033b36277e632e403de1 100644 (file)
@@ -8,15 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zsh
-PKG_VERSION:=5.5.1
+PKG_VERSION:=5.6.2
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@SF/zsh
-PKG_HASH:=774caa89e7aea5f33c3033cbffd93e28707f72ba5149c79709e48e6c2d2ee080
+PKG_HASH:=a50bd66c0557e8eca3b8fa24e85d0de533e775d7a22df042da90488623752e9e
+
 PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
 PKG_LICENSE:=ZSH
+PKG_LICENSE_FILES:=LICENCE
+PKG_CPE_ID:=cpe:/a:zsh_project:zsh
 
+PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
@@ -27,7 +31,7 @@ define Package/zsh
   SUBMENU:=Shells
   TITLE:=The Z shell
   DEPENDS:=+libcap +libncurses +libncursesw +libpcre +librt
-  URL:=http://www.zsh.org/
+  URL:=https://www.zsh.org/
 endef
 
 define Package/zsh/description