summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-05-11 13:24:04 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-05-11 13:29:33 -0500
commit543b54a34e2c709c2c4d09a29a0d2676b1bb2c1f (patch)
treeb0a404d294db0137deedab547ce88776d1f4338c /src
parent74d355078879353d88668cce4f957db434fbdac5 (diff)
downloadofono-543b54a34e2c709c2c4d09a29a0d2676b1bb2c1f.tar.bz2
gprs: Make sure to clean up interfaces
When going down, it is sometimes possible for us not to ifconfig down the interface or reset the MMS context IPv4 address propertly
Diffstat (limited to 'src')
-rw-r--r--src/gprs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gprs.c b/src/gprs.c
index 0c709ad6..9d6e8297 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1362,6 +1362,16 @@ static gboolean context_dbus_unregister(struct pri_context *ctx)
DBusConnection *conn = ofono_dbus_get_connection();
char path[256];
+ if (ctx->active == TRUE) {
+ const char *interface =
+ ctx->context_driver->settings->interface;
+
+ if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS)
+ pri_set_ipv4_addr(interface, NULL);
+
+ pri_ifupdown(interface, FALSE);
+ }
+
strcpy(path, ctx->path);
idmap_put(ctx->gprs->pid_map, ctx->id);