summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-03-30 08:41:46 +0200
committerThomas Haller <thaller@redhat.com>2023-03-30 08:41:46 +0200
commit9ed802b0c289ec785efb23e76272e61466242d8b (patch)
tree3f1fa81331648488bb44db61cd20b4c3b6762b4b
parentc4aa969a43e55d638ca4a75aea6eb214318ee68b (diff)
parentbb226d4ed1e9d5737e370d93e505a81bbfff6911 (diff)
downloadNetworkManager-9ed802b0c289ec785efb23e76272e61466242d8b.tar.gz
wwan/ofono: merge branch 'peat-psuwit:for-upstream/combined-context-mms-proxy-route'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1584
-rw-r--r--src/core/devices/wwan/nm-modem-ofono.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/devices/wwan/nm-modem-ofono.c b/src/core/devices/wwan/nm-modem-ofono.c
index 33a19e9366..de105bbdd3 100644
--- a/src/core/devices/wwan/nm-modem-ofono.c
+++ b/src/core/devices/wwan/nm-modem-ofono.c
@@ -1320,9 +1320,18 @@ handle_settings(NMModemOfono *self, GVariant *v_dict)
}
}
- if (g_variant_lookup(v_dict, "MessageProxy", "&s", &s)) {
- _LOGI("MessageProxy: %s", s);
- if (s && nm_inet_parse_bin(AF_INET, s, NULL, &address_network)) {
+ if (g_variant_lookup(v_dict, "Proxy", "&s", &s) && s) {
+ gs_free char *proxy = g_strdup(s);
+ char *colon;
+
+ _LOGI("(MMS) Proxy: %s", s);
+
+ /* Strip the port out. We can do this as we know this is IPv4. */
+ colon = strchr(proxy, ':');
+ if (colon)
+ *colon = '\0';
+
+ if (nm_inet_parse_bin(AF_INET, proxy, NULL, &address_network)) {
const NMPlatformIP4Route mms_route = {
.network = address_network,
.plen = 32,
@@ -1335,7 +1344,7 @@ handle_settings(NMModemOfono *self, GVariant *v_dict)
nm_l3_config_data_add_route_4(priv->l3cd_4, &mms_route);
} else
- _LOGW("invalid MessageProxy: %s", s);
+ _LOGW("invalid (MMS) Proxy: %s", s);
}
ret = TRUE;