Hi Thierry,
On Wed, May 11, 2011 at 12:54:20AM +0200, Thierry Boureille wrote:
> Hi,
> while checking connman's traces I've noticed dhcp_release is called
> twice on same pointer when releasing dhcp connection (due to manual
> setting or unplugging wire).
> I suggest following correction cause dhcp_release is called by
> removing hash table entry due to line 458 :network_table =
> g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
> remove_network) :
Good catch, I slightly improved your patch ato this:
diff --git a/src/dhcp.c b/src/dhcp.c
index 03a2b90..f1e3096 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -438,16 +438,8 @@ int __connman_dhcp_start(struct connman_network *network,
d
void __connman_dhcp_stop(struct connman_network *network)
{
- struct connman_dhcp *dhcp;
-
DBG("");
- dhcp = g_hash_table_lookup(network_table, network);
- if (dhcp == NULL)
- return;
-
- dhcp_release(dhcp);
-
g_hash_table_remove(network_table, network);
}
As we no longer need the dhcp pointer.
A few additional comments: In the future, please use a proper subject when
sending patches ([PATCH] dhcp:.... would have been better), and keep in mind
that the mail body will end up being the patch changelog.
Thanks for the patch, it's applied (in the above form) to the ConnMan tree
now.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman