aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-05-06 02:32:07 +0200
committerJakub Jirutka <jakub@jirutka.cz>2022-05-06 02:33:17 +0200
commit1653474e4805e5b1b059510f7badeded70a74a09 (patch)
tree9254706e9599d106e83d9b7499d7d9a845f1fcb2
parent2a7d63373b2ea4fdbaad2af2e6976cc237e27360 (diff)
downloadaports-1653474e4805e5b1b059510f7badeded70a74a09.tar.gz
aports-1653474e4805e5b1b059510f7badeded70a74a09.tar.bz2
aports-1653474e4805e5b1b059510f7badeded70a74a09.tar.xz
community/connman: add Ethernet property for VPN into GetServices method
-rw-r--r--community/connman/APKBUILD4
-rw-r--r--community/connman/add-ethernet-prop-for-vpn-to-dbus.patch79
2 files changed, 82 insertions, 1 deletions
diff --git a/community/connman/APKBUILD b/community/connman/APKBUILD
index 0a725d0f7c..616d5ae439 100644
--- a/community/connman/APKBUILD
+++ b/community/connman/APKBUILD
@@ -3,7 +3,7 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
pkgname=connman
pkgver=1.41
-pkgrel=0
+pkgrel=1
pkgdesc="Daemon for managing internet connections"
url="https://git.kernel.org/pub/scm/network/connman/connman.git"
arch="all"
@@ -41,6 +41,7 @@ subpackages="
source="https://www.kernel.org/pub/linux/network/connman/connman-$pkgver.tar.xz
libresolv.patch
dbus-rules.patch
+ add-ethernet-prop-for-vpn-to-dbus.patch
openvpn.conf
$pkgname.initd
$pkgname.confd
@@ -172,6 +173,7 @@ sha512sums="
b7880d908635ab9350c12e207213d20b11c1a50afcb93ae92e1fc57d4345bf792afe1a5534650e18b8cd05a3766ce9993083b2d659e49f87b867e6f2c1a83b2d connman-1.41.tar.xz
122b48fc9e25354e25ba3a3e0864bdd84da84457fed94aeea726bcb189b2f05f2cc361ae15f44af5c49bcee572e91e4c0488ef3b0bc79d20f6efe15853fb6b3a libresolv.patch
0223dba51be67c131c297d0e865fe1276e4800be5eee25c4f142df8e651318bf5dae98c1d559bb70c002cdfc3ce3c24d12128ddca5656192f962d91af6906caa dbus-rules.patch
+fa2cd99400ebff23d4397c3ac61f771cbf7b3ce3dfe93d71ed311f66a09d16d0ff87d7f6737da606cac29933231f89cfa9fe6872fe8cac12acfc133b53cbc05e add-ethernet-prop-for-vpn-to-dbus.patch
7f90bfdbe27a468c401bde04ccedc7d15afba11ca460ee6155233c3ef99285033303cbf7afac3849cbcd6e95a90eae5bdc772e416aef57e5ada7c4eed38f4de9 openvpn.conf
4bedfb21a941f6fc1f854a565dcdb1b8675888c23a112ad60645c56e7c602029089a067d0317cc156a3edf624ebbc8d0696bfb61a4b09c9becd04ee3b1d65a29 connman.initd
73f505a777df04039ca51bc3959aa89969a0bbc21ea971fb98e04e9b5851553de35955453ed859f5a6273724bbcce38f13012950c6cb4e0a2bc80bc531ccff1e connman.confd
diff --git a/community/connman/add-ethernet-prop-for-vpn-to-dbus.patch b/community/connman/add-ethernet-prop-for-vpn-to-dbus.patch
new file mode 100644
index 0000000000..954c34aabc
--- /dev/null
+++ b/community/connman/add-ethernet-prop-for-vpn-to-dbus.patch
@@ -0,0 +1,79 @@
+Patch-Source: https://lore.kernel.org/connman/20220426194853.13343-1-jakub@jirutka.cz
+--
+From: Jakub Jirutka <jakub@jirutka.cz>
+Subject: [PATCH] service: Add "Ethernet" property for VPN into n.c.Manager GetServices
+Date: Tue, 26 Apr 2022 21:48:53 +0200
+
+Scope:
+This patch affects the Service properties exposed by D-Bus method
+GetServices in interface net.connman.Manager.
+
+Before (current state):
+Services of type WIFI, ETHERNET, BLUETOOTH, and GADGET have property
+"Ethernet" with a dictionary of "Method", "Interface", "Address", and
+"MTU". Services of type VPN (and also P2P, GPS, and SYSTEM) don't include
+this property, althrough VPNs are IP-based too and the data is available
+(at least for some, e.g. OpenVPN, not sure if all).
+
+After (proposed change):
+Even services of type VPN includes property "Ethernet".
+
+Motivation:
+ConnMan integration with resolvconf(8) via D-Bus
+(https://github.com/jirutka/connman-resolvconf) - I need to know
+"Interface" even for VPN services.
+
+Considerations:
+Function append_ethernet in src/service.c checks if either
+service->ipconfig_ipv4 or service->ipconfig_ipv6 is non-NULL and do
+nothing if this condition is not satisfied. Otherwise,
+__connman_ipconfig_append_ethernet from src/ipconfig.c is called.
+This function checks if the index of passed service->ipconfig_ipv4
+(or _ipv6) is present in ipdevice_hash. If it's not, it just sets
+"Method" property with value "auto" and returns.
+Thus I think this change shouldn't break anything, even if ipconfig
+data is not available for some VPN types. I tested it myself with just
+OpenVPN provider though.
+
+This may introduce an asymmetry between Service properties returned by
+GetServices and signal PropertyChanged in interface net.connman.Service
+- change in "Ethernet" is currently not being announced for VPN
+services. I originally wanted to implement this as well (actually, before
+GetServices), but got lost in code duplication and unclear relation
+between src/ and vpn/.
+Anyway, I don't think this asymetry is a problem (and probably more
+asymetries already exist there?).
+
+I didn't consider method GetProperties in interface net.connman.Service
+at all, because it's marked as deprecated. However, I hope that it
+calls the same functions as the method GetServices.
+
+The same change should be considered even for P2P services, but I don't
+use this service type and didn't look into its specifics.
+---
+ src/service.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/service.c b/src/service.c
+index 66ab99d8..988928e7 100644
+--- a/src/service.c
++++ b/src/service.c
+@@ -2593,7 +2593,6 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
+ case CONNMAN_SERVICE_TYPE_UNKNOWN:
+ case CONNMAN_SERVICE_TYPE_SYSTEM:
+ case CONNMAN_SERVICE_TYPE_GPS:
+- case CONNMAN_SERVICE_TYPE_VPN:
+ case CONNMAN_SERVICE_TYPE_P2P:
+ break;
+ case CONNMAN_SERVICE_TYPE_CELLULAR:
+@@ -2604,6 +2603,7 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
+ connman_dbus_dict_append_dict(dict, "Ethernet",
+ append_ethernet, service);
+ break;
++ case CONNMAN_SERVICE_TYPE_VPN:
+ case CONNMAN_SERVICE_TYPE_WIFI:
+ case CONNMAN_SERVICE_TYPE_ETHERNET:
+ case CONNMAN_SERVICE_TYPE_BLUETOOTH:
+--
+2.16.4
+