CHROMIUM: modemmanager-next: Allow MBIM bearer to access IPv4 address when requested IP type is IPv6

On T-mobile network when we request for IPv6 (only),
to support roaming, the network responds back with both IPv4 and IPv6 address.
MM does not pass on the IPv4 address to shill,
which internally causes shill to connect/disconnect from the network making the connection unusable.
This change basically passes the IPv4 config to shill if it's present.

BUG=b:183029202, b:162701578
TEST=emerge-hatch modemmanager-next && cros deploy && Check if we have
network access && run cellular_Identifiers.tmobile,
cellular_SafetyDance.tmobile

Change-Id: Ifa2b92f8af9b3854c4c1dbf130178bb738d45bc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/modemmanager-next/+/2802712
Reviewed-by: Andrew Lassalle <andrewlassalle@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Commit-Queue: Madhav . <madhavadas@google.com>
Tested-by: Madhav . <madhavadas@google.com>
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index b808f54..4cd2f3d 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -398,6 +398,9 @@
 
         /* Build IPv4 config */
         if (ctx->requested_ip_type == MBIM_CONTEXT_IP_TYPE_IPV4 ||
+#if defined SUPPORT_MBIM_IPV6_WITH_IPV4_ROAMING //TODO(b/183029202): Remove hacks before merging to upstream
+            ctx->requested_ip_type == MBIM_CONTEXT_IP_TYPE_IPV6 ||
+#endif
             ctx->requested_ip_type == MBIM_CONTEXT_IP_TYPE_IPV4V6 ||
             ctx->requested_ip_type == MBIM_CONTEXT_IP_TYPE_IPV4_AND_IPV6) {
             gboolean address_set = FALSE;
@@ -538,11 +541,14 @@
              * otherwise use DHCP to indicate the missing ones should be
              * retrieved from SLAAC or DHCPv6.
              */
+#if defined SUPPORT_MBIM_IPV6_WITH_IPV4_ROAMING //TODO(b/183029202): Remove hacks before merging to upstream
+            mm_bearer_ip_config_set_method (ipv6_config, MM_BEARER_IP_METHOD_STATIC);
+#else
             if (address_set && gateway_set && dns_set)
                 mm_bearer_ip_config_set_method (ipv6_config, MM_BEARER_IP_METHOD_STATIC);
             else
                 mm_bearer_ip_config_set_method (ipv6_config, MM_BEARER_IP_METHOD_DHCP);
-
+#endif
             /* We requested IPv6, but it wasn't reported as activated. If there is no IPv6 address
              * provided by the modem, we assume the IPv6 bearer wasn't truly activated */
             if (!address_set &&