modem: ensure PPP manager is always cleaned up

While this should never happen while the PPP manager is alive, modems
can switch their IP method while alive, since the net port is sometimes
discovered after the serial ports have been.  This happens for some
devices that have separate drivers for the net and serial sides, like
ZTE Icera-based devices (cdc-ether and cdc-acm) and newer Sierra
devices (sierra and sierra-net).  Just be paranoid here and ensure
that the PPP manager gets cleaned up.

Partial attempt at fixing lp:752143
This commit is contained in:
Dan Williams 2011-04-19 09:38:23 -05:00
parent ee3d29107f
commit 6d9c4c64b4

View file

@ -658,12 +658,13 @@ real_deactivate (NMModem *self, NMDevice *device)
priv->in_bytes = priv->out_bytes = 0;
if (priv->ppp_manager) {
g_object_unref (priv->ppp_manager);
priv->ppp_manager = NULL;
}
switch (priv->ip_method) {
case MM_MODEM_IP_METHOD_PPP:
if (priv->ppp_manager) {
g_object_unref (priv->ppp_manager);
priv->ppp_manager = NULL;
}
break;
case MM_MODEM_IP_METHOD_STATIC:
case MM_MODEM_IP_METHOD_DHCP: