diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-09-07 10:04:40 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-09-07 14:41:51 +0300 |
commit | 434d46d978c3d5b99b4856552ee5ab56eb156424 (patch) | |
tree | 7874ba3a78132efe312a554435553d488d13ab2b /src/tethering.c | |
parent | 18d852960a02a9939616787043cddea68e92f226 (diff) | |
download | connman-434d46d978c3d5b99b4856552ee5ab56eb156424.tar.gz connman-434d46d978c3d5b99b4856552ee5ab56eb156424.tar.bz2 connman-434d46d978c3d5b99b4856552ee5ab56eb156424.zip |
tethering: Fix error path in __connman_tethering_set_enabled()
In some cases we did not destroy the bridge and ip pool.
Diffstat (limited to 'src/tethering.c')
-rw-r--r-- | src/tethering.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tethering.c b/src/tethering.c index 2d66cda3..e3432371 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -206,6 +206,7 @@ void __connman_tethering_set_enabled(void) tethering_restart, NULL); if (dhcp_ippool == NULL) { connman_error("Fail to create IP pool"); + __connman_bridge_remove(BRIDGE_NAME); return; } @@ -217,6 +218,7 @@ void __connman_tethering_set_enabled(void) err = __connman_bridge_enable(BRIDGE_NAME, gateway, broadcast); if (err < 0 && err != -EALREADY) { + __connman_ippool_unref(dhcp_ippool); __connman_bridge_remove(BRIDGE_NAME); return; } @@ -234,6 +236,7 @@ void __connman_tethering_set_enabled(void) 24 * 3600, dns); if (tethering_dhcp_server == NULL) { __connman_bridge_disable(BRIDGE_NAME); + __connman_ippool_unref(dhcp_ippool); __connman_bridge_remove(BRIDGE_NAME); return; } |