Networker:
authorWilfried Goesgens <dothebart@citadel.org>
Fri, 25 May 2012 13:01:44 +0000 (15:01 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Fri, 25 May 2012 13:01:44 +0000 (15:01 +0200)
  - network_learn_topology (): fix prepending of new netmap item to linked list
  - fix removal of spool files not associated anymore

citadel/modules/network/serv_netspool.c

index 06fa3a82f5a3c8e142d09b2272f8980c85f19244..de98a3cf1ff68193193cd79f507f4a806ceb5a8a 100644 (file)
@@ -95,7 +95,8 @@
 /*
  * Learn topology from path fields
  */
-void network_learn_topology(char *node, char *path, NetMap **the_netmap, int *netmap_changed) {
+static void network_learn_topology(char *node, char *path, NetMap **the_netmap, int *netmap_changed)
+{
        char nexthop[256];
        NetMap *nmptr;
 
@@ -117,7 +118,7 @@ void network_learn_topology(char *node, char *path, NetMap **the_netmap, int *ne
        nmptr->lastcontact = time(NULL);
        extract_token(nmptr->nexthop, path, 0, '!', sizeof nmptr->nexthop);
        nmptr->next = *the_netmap;
-       the_netmap = &nmptr;
+       *the_netmap = nmptr;
        (*netmap_changed) ++;
 }
 
@@ -834,9 +835,7 @@ void network_consolidate_spoolout(char *working_ignetcfg, NetMap *the_netmap)
        while (d = readdir(dp), d != NULL) {
                if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
                        continue;
-               ptr = strchr(d->d_name, '@');
-               if (d != NULL)
-                       continue;
+
                snprintf(filename, 
                        sizeof filename,
                        "%s/%s",