freecwmp
[Top] [All Lists]

Boot event in every periodic inform

To: "freecwmp@linux-mips.org" <freecwmp@linux-mips.org>
Subject: Boot event in every periodic inform
From: Rajsek Miroslav <miroslav.rajsek@innbox.net>
Date: Tue, 19 Feb 2013 10:23:35 +0100
Accept-language: sl-SI
Acceptlanguage: sl-SI
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
Thread-index: AQHODoLK5V0JE7sCJkOE9V0+hS+/gw==
Thread-topic: Boot event in every periodic inform
Hi Luka, hi everybody

I have noticed that every periodic inform sent out from my freecwmpd contains 
boot event.
I wrote a patch for this, please can you check it.

Besides, my valgrind showed some problems when removing events from uci list, 
but I am not familiar with uci and could not find a solution for now.
It looks like reusing a reference that has been freed. Perhaps you see 
something at a glance...
It happened also when removing bootstrap event with no patch applied.

Regards,

Miroslav
------------------------------
The symptoms:
==23169== Invalid read of size 1
==23169==    at 0x4026063: __GI_strlen (mc_replace_strmem.c:284)
==23169==    by 0x4134254: strdup (strdup.c:42)
==23169==    by 0x40453FD: uci_strdup (util.c:59)
==23169==    by 0x404203E: uci_alloc_generic (list.c:52)
==23169==    by 0x40460B6: uci_add_delta (delta.c:45)
==23169==    by 0x4042EF1: uci_del_list (list.c:636)
==23169==    by 0x804A5F6: config_remove_event (config.c:433)
==23169==    by 0x804BD29: cwmp_remove_event (cwmp.c:235)
==23169==    by 0x804C103: cwmp_inform (cwmp.c:117)
==23169==    by 0x404BE30: uloop_run (uloop.c:476)
==23169==    by 0x804D23D: main (freecwmp.c:284)
==23169==  Address 0x4761b1c is 20 bytes inside a block of size 30 free'd
==23169==    at 0x4024B3A: free (vg_replace_malloc.c:366)
==23169==    by 0x804A5DE: config_remove_event (config.c:431)
==23169==    by 0x804BD29: cwmp_remove_event (cwmp.c:235)
==23169==    by 0x804C103: cwmp_inform (cwmp.c:117)
==23169==    by 0x404BE30: uloop_run (uloop.c:476)
==23169==    by 0x804D23D: main (freecwmp.c:284)
==23169==
---------------------------------

The patch for removing boot event:
----------------------------------
Signed-off-by: Miroslav Rajsek <miroslav.rajsek@innbox.net>
---
 src/cwmp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/cwmp.c b/src/cwmp.c
index 2e45a30..d6b3936 100644
--- a/src/cwmp.c
+++ b/src/cwmp.c
@@ -113,6 +113,7 @@ int cwmp_inform(void)
  FREE(msg_out);

  cwmp_remove_event(BOOTSTRAP);
+ cwmp_remove_event(BOOT);
  cwmp_clear_notifications();
  http_client_exit();
  xml_exit();
@@ -227,7 +228,7 @@ void cwmp_remove_event(int code)

  list_for_each_entry_safe(n, p, &cwmp->events, list) {
   if (code == n->code) {
-   config_remove_event(lfc_str_event_code(0, true));
+   config_remove_event(lfc_str_event_code(code, true));
    FREE(n->key);
    list_del(&n->list);
    FREE(n);
--
1.7.0.4

This e-mail and any attachments may contain confidential and/or privileged 
information and is intended solely for the addressee. Any unauthorised use, 
review, retransmissions, dissemination, copying or other use of this 
information by persons or entities other than the intended recipient is 
strictly prohibited.

To elektronsko sporo?ilo in vse morebitne priloge lahko vsebujejo informacije 
zaupne narave in so namenjene izklju?no naslovniku. Fizi?ni ali pravni osebi, 
ki ni naslovnik, je kakr?nakoli nepoobla??ena uporaba, pregledovanje, 
po?iljanje, raz?irjanje, kopiranje ali drug na?in razpolaganja z vsebino 
sporo?ila strogo prepovedana.

<Prev in Thread] Current Thread [Next in Thread>
  • Boot event in every periodic inform, Rajsek Miroslav <=