modem-manager: don't report the data interface along with the IPv4 configuration

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.
This commit is contained in:
Aleksander Morgado 2012-11-07 15:40:41 +01:00 committed by Dan Williams
parent c9579b1bf0
commit 998b9295c9
6 changed files with 14 additions and 22 deletions

View file

@ -744,11 +744,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;
}

View file

@ -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);
}

View file

@ -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,

View file

@ -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);

View file

@ -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

View file

@ -139,7 +139,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)
@ -154,12 +153,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