Hi Mohamed,
On Fri, Dec 17, 2010 at 03:31:29PM -0800, Mohamed Abbas wrote:
> This bug related to src/ipconfig.c in function __connman_ipconfig_enable
> we are removing the wrong entry in ipconfig_list which caused to leave
> etries after services goes away causing the crash becuase we are
> touching a gone memory.
>
> I also added some checks for NULL pointer in service_ops callback
> pointers.
> ---
> src/ipconfig.c | 6 ++++--
> src/service.c | 48 +++++++++++++++++++++++++++++++++++++++++-------
> 2 files changed, 45 insertions(+), 9 deletions(-)
>
> diff --git a/src/ipconfig.c b/src/ipconfig.c
> index 90b4f16..0518e10 100644
> --- a/src/ipconfig.c
> +++ b/src/ipconfig.c
> @@ -1218,7 +1218,8 @@ int __connman_ipconfig_enable(struct connman_ipconfig
> *ipconfig)
>
> if (type == CONNMAN_IPCONFIG_TYPE_IPV4 &&
> ipdevice->config_ipv4 != NULL) {
> - ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
> + ipconfig_list = g_list_remove(ipconfig_list,
> + ipdevice->config_ipv4);
>
> connman_ipaddress_clear(ipdevice->config_ipv4->system);
>
> @@ -1227,7 +1228,8 @@ int __connman_ipconfig_enable(struct connman_ipconfig
> *ipconfig)
>
> if (type == CONNMAN_IPCONFIG_TYPE_IPV6 &&
> ipdevice->config_ipv6 != NULL) {
> - ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
> + ipconfig_list = g_list_remove(ipconfig_list,
> + ipdevice->config_ipv6);
>
> connman_ipaddress_clear(ipdevice->config_ipv6->system);
This part of the patch makes sense, and I applied it. Thanks.
As for the second part (which should be a separate patch btw): It's fixing the
symptoms, not the actual issue. If we're calliing service_up and
connman_ipconfig_get_data() returns NULL, there is a race somewhere that
needs to be fixed. I'm ok with adding some NULL checking, but first I'd like
to get to the bottom of this issue. Otherwise we're just going to hide it with
the below checks.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman