aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
15 files changed, 318 insertions, 82 deletions
diff --git a/lang/perl/Makefile b/lang/perl/Makefile
index 7c7dde21c..465d5768c 100644
--- a/lang/perl/Makefile
+++ b/lang/perl/Makefile
@@ -11,7 +11,7 @@ include perlver.mk
PKG_NAME:=perl
PKG_VERSION:=$(PERL_VERSION)
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE_URL:=\
https://cpan.metacpan.org/src/5.0 \
diff --git a/lang/perl/patches/301-fix_macos_static_linking.patch b/lang/perl/patches/301-fix_macos_static_linking.patch
new file mode 100644
index 000000000..4b4ef925e
--- /dev/null
+++ b/lang/perl/patches/301-fix_macos_static_linking.patch
@@ -0,0 +1,19 @@
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2738,14 +2738,14 @@ sub _find_static_libs {
+
+ Called by a utility method of makeaperl. Checks whether a given file
+ is an XS library by seeing whether it defines any symbols starting
+-with C<boot_>.
++with C<boot_> (with an optional leading underscore – needed on MacOS).
+
+ =cut
+
+ sub xs_static_lib_is_xs {
+ my ($self, $libfile) = @_;
+ my $devnull = File::Spec->devnull;
+- return `nm $libfile 2>$devnull` =~ /\bboot_/;
++ return `nm $libfile 2>$devnull` =~ /\b_?boot_/;
+ }
+
+ =item makefile (o)
diff --git a/libs/spice/Makefile b/libs/spice/Makefile
index 5e4906a36..4ec30f772 100644
--- a/libs/spice/Makefile
+++ b/libs/spice/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=spice
PKG_VERSION:=0.14.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.spice-space.org/download/releases/spice-server
PKG_HASH:=b203b3882e06f4c7249a3150d90c84e1a90490d41ead255a3d2cede46f4a29a7
@@ -18,6 +18,7 @@ PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+PKG_FIXUP:=autoreconf
PKG_BUILD_DEPENDS+=spice-protocol
include $(INCLUDE_DIR)/package.mk
diff --git a/libs/spice/patches/0001-reds-Fix-SSL_CTX_set_ecdh_auto-call-for-some-old-Ope.patch b/libs/spice/patches/0001-reds-Fix-SSL_CTX_set_ecdh_auto-call-for-some-old-Ope.patch
new file mode 100644
index 000000000..046bf251c
--- /dev/null
+++ b/libs/spice/patches/0001-reds-Fix-SSL_CTX_set_ecdh_auto-call-for-some-old-Ope.patch
@@ -0,0 +1,48 @@
+From 214736dce643ce3ee257da017373e88cc19d2d3b Mon Sep 17 00:00:00 2001
+From: Frediano Ziglio <fziglio@redhat.com>
+Date: Thu, 20 Jun 2019 13:26:11 +0100
+Subject: [PATCH] reds: Fix SSL_CTX_set_ecdh_auto call for some old OpenSSL
+
+SSL_CTX_set_ecdh_auto is not defined in some old versions of OpenSSL
+
+Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
+Acked-by: Jeremy White <jwhite@codeweavers.com>
+---
+ configure.ac | 9 +++++++++
+ server/reds.c | 2 ++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index e12d7e85..49c009d4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -209,6 +209,15 @@ AC_SUBST(SSL_CFLAGS)
+ AC_SUBST(SSL_LIBS)
+ AS_VAR_APPEND([SPICE_REQUIRES], [" openssl"])
+
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS $SSL_CFLAGS"
++AC_CHECK_DECLS([SSL_CTX_set_ecdh_auto], [], [], [
++AC_INCLUDES_DEFAULT
++#include <openssl/err.h>
++#include <openssl/ssl.h>
++])
++CFLAGS="$save_CFLAGS"
++
+ AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
+ AC_MSG_CHECKING([for jpeglib.h])
+ AC_TRY_CPP(
+diff --git a/server/reds.c b/server/reds.c
+index 792e9838..b4061fbc 100644
+--- a/server/reds.c
++++ b/server/reds.c
+@@ -2937,7 +2937,9 @@ static int reds_init_ssl(RedsState *reds)
+ }
+
+ SSL_CTX_set_options(reds->ctx, ssl_options);
++#if HAVE_DECL_SSL_CTX_SET_ECDH_AUTO || defined(SSL_CTX_set_ecdh_auto)
+ SSL_CTX_set_ecdh_auto(reds->ctx, 1);
++#endif
+
+ /* Load our keys and certificates*/
+ return_code = SSL_CTX_use_certificate_chain_file(reds->ctx, reds->config->ssl_parameters.certs_file);
diff --git a/libs/spice/patches/0002-reds-Fix-compilation-without-deprecated-OpenSSL-1.1-.patch b/libs/spice/patches/0002-reds-Fix-compilation-without-deprecated-OpenSSL-1.1-.patch
new file mode 100644
index 000000000..9923e4c78
--- /dev/null
+++ b/libs/spice/patches/0002-reds-Fix-compilation-without-deprecated-OpenSSL-1.1-.patch
@@ -0,0 +1,78 @@
+From 5bc932f7a71ede7d8ecd9d88804af95a2eb955c0 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Sun, 3 Nov 2019 15:34:33 -0800
+Subject: [PATCH] reds: Fix compilation without deprecated OpenSSL 1.1 APIs
+
+Missing headers for BN_ and RSA_ functions.
+
+Initialization is deprecated with 1.1.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+Acked-by: Frediano Ziglio <fziglio@redhat.com>
+---
+AUTHORS hunk removed as it does not apply (with 0.14.2 at least)
+
+ AUTHORS | 1 +
+ server/reds.c | 24 ++++++++++++++++--------
+ 2 files changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/server/reds.c b/server/reds.c
+index c55aa3f8..dc03ef3a 100644
+--- a/server/reds.c
++++ b/server/reds.c
+@@ -36,7 +36,9 @@
+ #include <ws2tcpip.h>
+ #endif
+
++#include <openssl/bn.h>
+ #include <openssl/err.h>
++#include <openssl/rsa.h>
+
+ #if HAVE_SASL
+ #include <sasl/sasl.h>
+@@ -2838,13 +2840,8 @@ static void openssl_thread_setup(void)
+ CRYPTO_set_id_callback(pthreads_thread_id);
+ CRYPTO_set_locking_callback(pthreads_locking_callback);
+ }
+-#else
+-static inline void openssl_thread_setup(void)
+-{
+-}
+-#endif
+
+-static gpointer openssl_global_init(gpointer arg)
++static gpointer openssl_global_init_once(gpointer arg)
+ {
+ SSL_library_init();
+ SSL_load_error_strings();
+@@ -2854,9 +2851,20 @@ static gpointer openssl_global_init(gpointer arg)
+ return NULL;
+ }
+
+-static int reds_init_ssl(RedsState *reds)
++static inline void openssl_global_init(void)
+ {
+ static GOnce openssl_once = G_ONCE_INIT;
++ g_once(&openssl_once, openssl_global_init_once, NULL);
++}
++
++#else
++static inline void openssl_global_init(void)
++{
++}
++#endif
++
++static int reds_init_ssl(RedsState *reds)
++{
+ const SSL_METHOD *ssl_method;
+ int return_code;
+ /* Limit connection to TLSv1.1 or newer.
+@@ -2865,7 +2873,7 @@ static int reds_init_ssl(RedsState *reds)
+ long ssl_options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION | SSL_OP_NO_TLSv1;
+
+ /* Global system initialization*/
+- g_once(&openssl_once, openssl_global_init, NULL);
++ openssl_global_init();
+
+ /* Create our context*/
+ /* SSLv23_method() handles TLSv1.x in addition to SSLv2/v3 */
diff --git a/net/adblock/Makefile b/net/adblock/Makefile
index 77be3f50e..51355a12b 100644
--- a/net/adblock/Makefile
+++ b/net/adblock/Makefile
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=3.8.9
+PKG_VERSION:=3.8.10
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/adblock/files/adblock.init b/net/adblock/files/adblock.init
index 7d0f29d1a..d1367aed1 100755
--- a/net/adblock/files/adblock.init
+++ b/net/adblock/files/adblock.init
@@ -16,7 +16,7 @@ adb_script="/usr/bin/adblock.sh"
adb_pidfile="/var/run/adblock.pid"
if [ -s "${adb_pidfile}" ] && \
- [ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ]
+ [ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ] && [ "${action}" != "enabled" ]
then
exit 1
fi
diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh
index acf88815a..551b47a5c 100755
--- a/net/adblock/files/adblock.sh
+++ b/net/adblock/files/adblock.sh
@@ -13,7 +13,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="3.8.9"
+adb_ver="3.8.10"
adb_basever=""
adb_enabled=0
adb_debug=0
diff --git a/net/banip/Makefile b/net/banip/Makefile
index 5cd5bcb9b..43a2c2ef4 100644
--- a/net/banip/Makefile
+++ b/net/banip/Makefile
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=banip
-PKG_VERSION:=0.3.8
+PKG_VERSION:=0.3.9
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/banip/files/banip.init b/net/banip/files/banip.init
index e9abfebad..c999c6b00 100755
--- a/net/banip/files/banip.init
+++ b/net/banip/files/banip.init
@@ -13,7 +13,7 @@ ban_script="/usr/bin/banip.sh"
ban_pidfile="/var/run/banip.pid"
if [ -s "${ban_pidfile}" ] && \
- [ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ]
+ [ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ] && [ "${action}" != "enabled" ]
then
exit 1
fi
diff --git a/net/banip/files/banip.sh b/net/banip/files/banip.sh
index 51345138f..c8639a9c6 100755
--- a/net/banip/files/banip.sh
+++ b/net/banip/files/banip.sh
@@ -13,7 +13,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-ban_ver="0.3.8"
+ban_ver="0.3.9"
ban_basever=""
ban_enabled=0
ban_automatic="1"
diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile
index 2ac58efc2..671701076 100644
--- a/net/dmapd/Makefile
+++ b/net/dmapd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dmapd
-PKG_VERSION:=0.0.83
+PKG_VERSION:=0.0.84
PKG_RELEASE:=1
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
@@ -18,9 +18,8 @@ PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.flyn.org/projects/dmapd
-PKG_HASH:=ab372ff217d2a74a33d62098fe501da663e5dded0df67e2c2c83d968fa9ac7b9
+PKG_HASH:=96d134e7c6d8e0394ee654903a184bfc200a3139692d124e7b11a3400138c8b2
-PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init
index 33a41f1eb..537f5499f 100644
--- a/net/dmapd/files/dmapd.init
+++ b/net/dmapd/files/dmapd.init
@@ -10,13 +10,9 @@ start_service() {
mkdir -m 0755 -p /var/run/dmapd
chown dmapd:dmapd /var/run/dmapd
}
- [ -d /var/db/dmapd/DAAP ] || {
- mkdir -m 0755 -p /var/db/dmapd/DAAP
- chown dmapd:dmapd /var/db/dmapd/DAAP
- }
- [ -d /var/db/dmapd/DPAP ] || {
- mkdir -m 0755 -p /var/db/dmapd/DPAP
- chown dmapd:dmapd /var/db/dmapd/DPAP
+ [ -d /var/db/dmapd ] || {
+ mkdir -m 0755 -p /var/db/dmapd
+ chown dmapd:dmapd /var/db/dmapd
}
mkdir -m 0755 -p /var/lock/subsys
mkdir -m 0755 -p /var/media/music
diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile
index 6ebcb4b8f..46ec511e5 100644
--- a/net/modemmanager/Makefile
+++ b/net/modemmanager/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager
PKG_VERSION:=1.12.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=ModemManager-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.freedesktop.org/software/ModemManager
diff --git a/net/modemmanager/files/modemmanager.proto b/net/modemmanager/files/modemmanager.proto
index 6fb763e5e..72e0bbf56 100755
--- a/net/modemmanager/files/modemmanager.proto
+++ b/net/modemmanager/files/modemmanager.proto
@@ -17,8 +17,8 @@ cdr2mask ()
set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
if [ "$1" -gt 1 ]
then
- shift "$1"
- else
+ shift "$1"
+ else
shift
fi
echo "${1-0}"."${2-0}"."${3-0}"."${4-0}"
@@ -111,7 +111,7 @@ modemmanager_cleanup_connection() {
}
}
-modemmanager_connected_method_ppp() {
+modemmanager_connected_method_ppp_ipv4() {
local interface="$1"
local ttyname="$2"
local username="$3"
@@ -139,7 +139,7 @@ modemmanager_connected_method_ppp() {
ip-down-script /lib/netifd/ppp-down
}
-modemmanager_disconnected_method_ppp() {
+modemmanager_disconnected_method_ppp_ipv4() {
local interface="$1"
echo "running disconnection (ppp method)"
@@ -163,12 +163,13 @@ modemmanager_disconnected_method_ppp() {
proto_kill_command "$interface"
}
-modemmanager_connected_method_dhcp() {
+modemmanager_connected_method_dhcp_ipv4() {
local interface="$1"
local wwan="$2"
local metric="$3"
proto_init_update "${wwan}" 1
+ proto_set_keep 1
proto_send_update "${interface}"
json_init
@@ -181,16 +182,7 @@ modemmanager_connected_method_dhcp() {
ubus call network add_dynamic "$(json_dump)"
}
-modemmanager_disconnected_method_dhcp() {
- local interface="$1"
-
- echo "running disconnection (dhcp method)"
-
- proto_init_update "*" 0
- proto_send_update "${interface}"
-}
-
-modemmanager_connected_method_static() {
+modemmanager_connected_method_static_ipv4() {
local interface="$1"
local wwan="$2"
local address="$3"
@@ -218,6 +210,7 @@ modemmanager_connected_method_static() {
# TODO: mtu reporting in proto handler
proto_init_update "${wwan}" 1
+ proto_set_keep 1
echo "adding IPv4 address ${address}, netmask ${mask}"
proto_add_ipv4_address "${address}" "${mask}"
[ -n "${gateway}" ] && {
@@ -236,10 +229,75 @@ modemmanager_connected_method_static() {
proto_send_update "${interface}"
}
-modemmanager_disconnected_method_static() {
+modemmanager_connected_method_dhcp_ipv6() {
local interface="$1"
+ local wwan="$2"
+ local metric="$3"
- echo "running disconnection (static method)"
+ proto_init_update "${wwan}" 1
+ proto_set_keep 1
+ proto_send_update "${interface}"
+
+ json_init
+ json_add_string name "${interface}_6"
+ json_add_string ifname "@${interface}"
+ json_add_string proto "dhcpv6"
+ proto_add_dynamic_defaults
+ json_add_string extendprefix 1 # RFC 7278: Extend an IPv6 /64 Prefix to LAN
+ [ -n "$metric" ] && json_add_int metric "${metric}"
+ json_close_object
+ ubus call network add_dynamic "$(json_dump)"
+}
+
+modemmanager_connected_method_static_ipv6() {
+ local interface="$1"
+ local wwan="$2"
+ local address="$3"
+ local prefix="$4"
+ local gateway="$5"
+ local mtu="$6"
+ local dns1="$7"
+ local dns2="$8"
+ local metric="$9"
+
+ [ -n "${address}" ] || {
+ proto_notify_error "${interface}" ADDRESS_MISSING
+ return
+ }
+
+ [ -n "${prefix}" ] || {
+ proto_notify_error "${interface}" PREFIX_MISSING
+ return
+ }
+
+ # TODO: mtu reporting in proto handler
+
+ proto_init_update "${wwan}" 1
+ proto_set_keep 1
+ echo "adding IPv6 address ${address}, prefix ${prefix}"
+ proto_add_ipv6_address "${address}" "128"
+ proto_add_ipv6_prefix "${address}/${prefix}"
+ [ -n "${gateway}" ] && {
+ echo "adding default IPv6 route via ${gateway}"
+ proto_add_ipv6_route "${gateway}" "128"
+ proto_add_ipv6_route "::0" "0" "${gateway}" "" "" "${address}/${prefix}"
+ }
+ [ -n "${dns1}" ] && {
+ echo "adding primary DNS at ${dns1}"
+ proto_add_dns_server "${dns1}"
+ }
+ [ -n "${dns2}" ] && {
+ echo "adding secondary DNS at ${dns2}"
+ proto_add_dns_server "${dns2}"
+ }
+ [ -n "$metric" ] && json_add_int metric "${metric}"
+ proto_send_update "${interface}"
+}
+
+modemmanager_disconnected_method_common() {
+ local interface="$1"
+
+ echo "running disconnection (common)"
proto_init_update "*" 0
proto_send_update "${interface}"
@@ -259,10 +317,11 @@ proto_modemmanager_setup() {
local interface="$1"
local modempath modemstatus bearercount bearerpath connectargs bearerstatus beareriface
+ local bearermethod_ipv4 bearermethod_ipv6
local operatorname operatorid registration accesstech signalquality
local device apn username password pincode iptype metric
-
+
local address prefix gateway mtu dns1 dns2
json_get_vars device apn username password pincode iptype metric
@@ -294,9 +353,12 @@ proto_modemmanager_setup() {
# always cleanup before attempting a new connection, just in case
modemmanager_cleanup_connection "${modemstatus}"
+ # ip type IPv4 is assumed if none explicitly given
+ [ -z "${iptype}" ] && iptype="ipv4"
+
# setup connect args; APN mandatory (even if it may be empty)
echo "starting connection with apn '${apn}'..."
- connectargs="apn=${apn}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}${iptype:+,ip-type=${iptype}}"
+ connectargs="apn=${apn},ip-type=${iptype}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}"
mmcli --modem="${device}" --timeout 120 --simple-connect="${connectargs}" || {
proto_notify_error "${interface}" CONNECT_FAILED
proto_block_restart "${interface}"
@@ -330,30 +392,66 @@ proto_modemmanager_setup() {
# load network interface and method information
beareriface=$(modemmanager_get_field "${bearerstatus}" "bearer.status.interface")
- bearermethod=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.method")
- echo "connection setup required in interface ${beareriface}: ${bearermethod}"
-
- case "${bearermethod}" in
- "dhcp")
- modemmanager_connected_method_dhcp "${interface}" "${beareriface}" "${metric}"
- ;;
- "static")
- address=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.address")
- prefix=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.prefix")
- gateway=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.gateway")
- mtu=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.mtu")
- dns1=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[1\]")
- dns2=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[2\]")
- modemmanager_connected_method_static "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}"
- ;;
- "ppp")
- modemmanager_connected_method_ppp "${interface}" "${beareriface}" "${username}" "${password}"
- ;;
- *)
- proto_notify_error "${interface}" UNKNOWN_METHOD
- return 1
- ;;
- esac
+ [ "$iptype" = "ipv4" ] || [ "$iptype" = "ipv4v6" ] && {
+ bearermethod_ipv4=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.method")
+ echo "IPv4 connection setup required in interface ${interface}: ${bearermethod_ipv4}"
+ }
+ [ "$iptype" = "ipv6" ] || [ "$iptype" = "ipv4v6" ] && {
+ bearermethod_ipv6=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.method")
+ echo "IPv6 connection setup required in interface ${interface}: ${bearermethod_ipv6}"
+ }
+
+ # setup IPv4
+ [ -n "${bearermethod_ipv4}" ] && {
+ case "${bearermethod_ipv4}" in
+ "dhcp")
+ modemmanager_connected_method_dhcp_ipv4 "${interface}" "${beareriface}" "${metric}"
+ ;;
+ "static")
+ address=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.address")
+ prefix=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.prefix")
+ gateway=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.gateway")
+ mtu=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.mtu")
+ dns1=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[1\]")
+ dns2=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.dns.value\[2\]")
+ modemmanager_connected_method_static_ipv4 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}"
+ ;;
+ "ppp")
+ modemmanager_connected_method_ppp_ipv4 "${interface}" "${beareriface}" "${username}" "${password}"
+ ;;
+ *)
+ proto_notify_error "${interface}" UNKNOWN_METHOD
+ return 1
+ ;;
+ esac
+ }
+
+ # setup IPv6
+ # note: if using ipv4v6, both IPv4 and IPv6 settings will have the same MTU and metric values reported
+ [ -n "${bearermethod_ipv6}" ] && {
+ case "${bearermethod_ipv6}" in
+ "dhcp")
+ modemmanager_connected_method_dhcp_ipv6 "${interface}" "${beareriface}" "${metric}"
+ ;;
+ "static")
+ address=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.address")
+ prefix=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.prefix")
+ gateway=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.gateway")
+ mtu=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.mtu")
+ dns1=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.dns.value\[1\]")
+ dns2=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.dns.value\[2\]")
+ modemmanager_connected_method_static_ipv6 "${interface}" "${beareriface}" "${address}" "${prefix}" "${gateway}" "${mtu}" "${dns1}" "${dns2}" "${metric}"
+ ;;
+ "ppp")
+ proto_notify_error "${interface}" "unsupported method"
+ return 1
+ ;;
+ *)
+ proto_notify_error "${interface}" UNKNOWN_METHOD
+ return 1
+ ;;
+ esac
+ }
return 0
}
@@ -362,9 +460,10 @@ proto_modemmanager_teardown() {
local interface="$1"
local modemstatus bearerpath errorstring
+ local bearermethod_ipv4 bearermethod_ipv6
- local device lowpower
- json_get_vars device lowpower
+ local device lowpower iptype
+ json_get_vars device lowpower iptype
echo "stopping network"
@@ -376,27 +475,23 @@ proto_modemmanager_teardown() {
return
}
- # load bearer connection method
+ # ip type IPv4 is assumed if none explicitly given
+ [ -z "${iptype}" ] && iptype="ipv4"
+
+ # load bearer connection methods
bearerstatus=$(mmcli --bearer "${bearerpath}" --output-keyvalue)
- bearermethod=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.method")
- [ -n "${bearermethod}" ] || {
- echo "couldn't load bearer method"
- return
+ [ "$iptype" = "ipv4" ] || [ "$iptype" = "ipv4v6" ] && {
+ bearermethod_ipv4=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv4-config.method")
+ echo "IPv4 connection teardown required in interface ${interface}: ${bearermethod_ipv4}"
+ }
+ [ "$iptype" = "ipv6" ] || [ "$iptype" = "ipv4v6" ] && {
+ bearermethod_ipv6=$(modemmanager_get_field "${bearerstatus}" "bearer.ipv6-config.method")
+ echo "IPv6 connection teardown required in interface ${interface}: ${bearermethod_ipv6}"
}
- case "${bearermethod}" in
- "dhcp")
- modemmanager_disconnected_method_dhcp "${interface}"
- ;;
- "static")
- modemmanager_disconnected_method_static "${interface}"
- ;;
- "ppp")
- modemmanager_disconnected_method_ppp "${interface}"
- ;;
- *)
- ;;
- esac
+ # disconnection handling only requires special treatment in IPv4/PPP
+ [ "${bearermethod_ipv4}" = "ppp" ] && modemmanager_disconnected_method_ppp_ipv4 "${interface}"
+ modemmanager_disconnected_method_common "${interface}"
# disconnect
mmcli --modem="${device}" --simple-disconnect ||