Fixed SEGV at program end: lq plugin was removed before calling parser_remove_func
authorSven-Ola Tuecke <sven-ola@gmx.de>
Fri, 21 Aug 2009 18:55:10 +0000 (20:55 +0200)
committerSven-Ola Tuecke <sven-ola@gmx.de>
Fri, 21 Aug 2009 18:55:10 +0000 (20:55 +0200)
lib/debuginfo/src/olsrd_debuginfo.c
lib/nameservice/src/nameservice.c
src/parser.c
src/parser.h
src/process_package.c

index 6915385..4c96aa4 100644 (file)
@@ -171,7 +171,7 @@ debuginfo_delete(void)
   for (i=0; i<ARRAYSIZE(commands); i++) {
     olsr_com_remove_normal_txtcommand(commands[i].cmd);
   }
-  olsr_parser_remove_function(&olsr_msg_statistics, PROMISCUOUS);
+  olsr_parser_remove_function(&olsr_msg_statistics);
   olsr_preprocessor_remove_function(&olsr_packet_statistics);
   ip_acl_flush(&allowed_nets);
 }
index 67137cc..a9ebec6 100644 (file)
@@ -495,7 +495,7 @@ name_destructor(void)
 {
   OLSR_INFO(LOG_PLUGINS, "NAME PLUGIN: exit. cleaning up...\n");
 
-  olsr_parser_remove_function(&olsr_parser, PARSER_TYPE);
+  olsr_parser_remove_function(&olsr_parser);
 
   free_name_entry_list(&my_names);
   free_name_entry_list(&my_services);
index 71d80b7..37cd509 100644 (file)
@@ -104,12 +104,12 @@ olsr_parser_add_function(parse_function * function, uint32_t type)
 }
 
 int
-olsr_parser_remove_function(parse_function * function, uint32_t type)
+olsr_parser_remove_function(parse_function * function)
 {
   struct parse_function_entry *entry, *prev;
 
   for (entry = parse_functions, prev = NULL; entry != NULL; prev = entry, entry = entry->next) {
-    if ((entry->function == function) && (entry->type == type)) {
+    if ((entry->function == function)) {
       if (entry == parse_functions) {
         parse_functions = entry->next;
       } else {
index 56628c2..e9403b4 100644 (file)
@@ -90,7 +90,7 @@ void
   EXPORT(olsr_parser_add_function) (parse_function, uint32_t);
 
 int
-  EXPORT(olsr_parser_remove_function) (parse_function, uint32_t);
+  EXPORT(olsr_parser_remove_function) (parse_function);
 
 void
   EXPORT(olsr_preprocessor_add_function) (preprocessor_function);
index 80d5ebc..c35ab19 100644 (file)
@@ -198,10 +198,10 @@ olsr_init_package_process(void)
 void
 olsr_deinit_package_process(void)
 {
-  olsr_parser_remove_function(&olsr_input_hello, olsr_get_Hello_MessageId());
-  olsr_parser_remove_function(&olsr_input_tc, olsr_get_TC_MessageId());
-  olsr_parser_remove_function(&olsr_input_mid, MID_MESSAGE);
-  olsr_parser_remove_function(&olsr_input_hna, HNA_MESSAGE);
+  olsr_parser_remove_function(&olsr_input_hello);
+  olsr_parser_remove_function(&olsr_input_tc);
+  olsr_parser_remove_function(&olsr_input_mid);
+  olsr_parser_remove_function(&olsr_input_hna);
 }
 
 static bool