The only case where this was being used was in PPP-based connections, as the
ppp0 interface was reported by pppd once the IP setup was done. Instead, just
update the 'NM_MODEM_DATA_PORT' property, as the NMDevices already listen for
changes in that property.
---
 src/modem-manager/nm-modem-broadband.c |  6 +-----
 src/modem-manager/nm-modem-generic.c   |  2 +-
 src/modem-manager/nm-modem.c           | 12 +++++++++---
 src/modem-manager/nm-modem.h           |  2 +-
 src/nm-device-bt.c                     |  7 +------
 src/nm-device-modem.c                  |  7 +------
 6 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/src/modem-manager/nm-modem-broadband.c 
b/src/modem-manager/nm-modem-broadband.c
index 45e37fa..34847ae 100644
--- a/src/modem-manager/nm-modem-broadband.c
+++ b/src/modem-manager/nm-modem-broadband.c
@@ -726,11 +726,7 @@ static_stage3_done (NMModemBroadband *self)
        }
 
 out:
-       g_signal_emit_by_name (self,
-                              NM_MODEM_IP4_CONFIG_RESULT,
-                              mm_bearer_get_interface (self->priv->bearer),
-                              config,
-                              error);
+       g_signal_emit_by_name (self, NM_MODEM_IP4_CONFIG_RESULT, config, error);
        g_clear_error (&error);
        return FALSE;
 }
diff --git a/src/modem-manager/nm-modem-generic.c 
b/src/modem-manager/nm-modem-generic.c
index 0214f1c..122be2c 100644
--- a/src/modem-manager/nm-modem-generic.c
+++ b/src/modem-manager/nm-modem-generic.c
@@ -225,7 +225,7 @@ static_stage3_done (DBusGProxy *proxy, DBusGProxyCall 
*call, gpointer user_data)
                g_value_array_free (ret_array);
        }
 
-       g_signal_emit_by_name (self, NM_MODEM_IP4_CONFIG_RESULT, NULL, config, 
error);
+       g_signal_emit_by_name (self, NM_MODEM_IP4_CONFIG_RESULT, config, error);
        g_clear_error (&error);
 }
 
diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c
index db5d4ee..45d1bdf 100644
--- a/src/modem-manager/nm-modem.c
+++ b/src/modem-manager/nm-modem.c
@@ -137,6 +137,7 @@ ppp_ip4_config (NMPPPManager *ppp_manager,
                                gpointer user_data)
 {
        NMModem *self = NM_MODEM (user_data);
+       NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (self);
        guint32 i, num;
        guint32 bad_dns1 = htonl (0x0A0B0C0D);
        guint32 good_dns1 = htonl (0x04020201);  /* GTE nameserver */
@@ -144,6 +145,11 @@ ppp_ip4_config (NMPPPManager *ppp_manager,
        guint32 good_dns2 = htonl (0x04020202);  /* GTE nameserver */
        gboolean dns_workaround = FALSE;
 
+       /* Notify about the new data port to use */
+       g_free (priv->data_port);
+       priv->data_port = g_strdup (iface);
+       g_object_notify (G_OBJECT (self), NM_MODEM_DATA_PORT);
+
        /* Work around a PPP bug (#1732) which causes many mobile broadband
         * providers to return 10.11.12.13 and 10.11.12.14 for the DNS servers.
         * Apparently fixed in ppp-2.4.5 but we've had some reports that this is
@@ -180,7 +186,7 @@ ppp_ip4_config (NMPPPManager *ppp_manager,
                nm_ip4_config_add_nameserver (config, good_dns2);
        }
 
-       g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, iface, config, 
NULL);
+       g_signal_emit (self, signals[IP4_CONFIG_RESULT], 0, config, NULL);
 }
 
 static void
@@ -885,8 +891,8 @@ nm_modem_class_init (NMModemClass *klass)
                              G_SIGNAL_RUN_FIRST,
                              G_STRUCT_OFFSET (NMModemClass, ip4_config_result),
                              NULL, NULL,
-                             _nm_marshal_VOID__STRING_OBJECT_POINTER,
-                             G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_OBJECT, 
G_TYPE_POINTER);
+                             _nm_marshal_VOID__OBJECT_POINTER,
+                             G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_POINTER);
 
        signals[PREPARE_RESULT] =
                g_signal_new (NM_MODEM_PREPARE_RESULT,
diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h
index c42f449..31e73c3 100644
--- a/src/modem-manager/nm-modem.h
+++ b/src/modem-manager/nm-modem.h
@@ -104,7 +104,7 @@ typedef struct {
        void (*ppp_failed) (NMModem *self, NMDeviceStateReason reason);
 
        void (*prepare_result)    (NMModem *self, gboolean success, 
NMDeviceStateReason reason);
-       void (*ip4_config_result) (NMModem *self, const char *iface, 
NMIP4Config *config, GError *error);
+       void (*ip4_config_result) (NMModem *self, NMIP4Config *config, GError 
*error);
 
        void (*auth_requested)    (NMModem *self);
        void (*auth_result)       (NMModem *self, GError *error);
diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c
index b0f42e1..d2cd9a3 100644
--- a/src/nm-device-bt.c
+++ b/src/nm-device-bt.c
@@ -553,7 +553,6 @@ device_state_changed (NMDevice *device,
 
 static void
 modem_ip4_config_result (NMModem *self,
-                         const char *iface,
                          NMIP4Config *config,
                          GError *error,
                          gpointer user_data)
@@ -570,12 +569,8 @@ modem_ip4_config_result (NMModem *self,
                             error && error->message ? error->message : 
"(unknown)");
 
                nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, 
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
-       } else {
-               if (iface)
-                       nm_device_set_ip_iface (device, iface);
-
+       } else
                nm_device_activate_schedule_ip4_config_result (device, config);
-       }
 }
 
 static void
diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c
index 4a3e978..9f3f20a 100644
--- a/src/nm-device-modem.c
+++ b/src/nm-device-modem.c
@@ -138,7 +138,6 @@ modem_auth_result (NMModem *modem, GError *error, gpointer 
user_data)
 
 static void
 modem_ip4_config_result (NMModem *self,
-                         const char *iface,
                          NMIP4Config *config,
                          GError *error,
                          gpointer user_data)
@@ -153,12 +152,8 @@ modem_ip4_config_result (NMModem *self,
                             error && error->message ? error->message : 
"(unknown)");
 
                nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, 
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
-       } else {
-               if (iface)
-                       nm_device_set_ip_iface (device, iface);
-
+       } else
                nm_device_activate_schedule_ip4_config_result (device, config);
-       }
 }
 
 static void
-- 
1.7.11.7

_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to