diff options
Diffstat (limited to 'community/connman/add-ethernet-prop-for-vpn-to-dbus.patch')
-rw-r--r-- | community/connman/add-ethernet-prop-for-vpn-to-dbus.patch | 79 |
1 files changed, 79 insertions, 0 deletions
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 00000000000..954c34aabcf --- /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 + |