Loading...

connman@connman.net

[Prev] Thread [Next]  |  [Prev] Date [Next]

[PATCH] inet: rs_cleanup: ensure data->channel exist before accessing it Otavio Salvador Mon Feb 27 10:01:11 2012

Log of segfault:
...
connmand[676]: src/network.c:check_dhcpv6() reply (nil)
connmand[676]: src/network.c:check_dhcpv6() re-send router solicitation 3
connmand[676]: src/inet.c:__connman_inet_ipv6_send_rs()
connmand[676]: Aborting (signal 11) [connmand]
---

The full log are available at
http://parenteses.org/mario/misc/connman-backtrace.txt

 src/inet.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/inet.c b/src/inet.c
index d9e12a9..5bf5f1b 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -1433,9 +1433,11 @@ static const struct in6_addr in6addr_all_routers_mc =

 static void rs_cleanup(struct rs_cb_data *data)
 {
-       g_io_channel_shutdown(data->channel, TRUE, NULL);
-       g_io_channel_unref(data->channel);
-       data->channel = 0;
+       if (data->channel) {
+               g_io_channel_shutdown(data->channel, TRUE, NULL);
+               g_io_channel_unref(data->channel);
+               data->channel = 0;
+       }

       if (data->rs_timeout > 0)
               g_source_remove(data->rs_timeout);
--
1.7.9.1

-- 
Otavio Salvador                             O.S. Systems
E-mail: [EMAIL PROTECTED] http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
_______________________________________________
connman mailing list
[EMAIL PROTECTED]
http://lists.connman.net/listinfo/connman