From (spam-protected) Wed Nov 1 10:20:15 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 01 Nov 2006 09:20:15 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h, 1.52, 1.53 process_routes.c, 1.27, 1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16656 Modified Files: defs.h process_routes.c Log Message: Removed assertion on hopcount Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** defs.h 7 Jan 2006 08:16:20 -0000 1.52 --- defs.h 1 Nov 2006 09:20:13 -0000 1.53 *************** *** 69,73 **** #endif - #define HOPCNT_MAX 32 /* maximum hops number */ #define MAXMESSAGESIZE 1500 /* max broadcast size */ #define UDP_IPV4_HDRSIZE 28 --- 69,72 ---- Index: process_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** process_routes.c 30 May 2005 13:13:38 -0000 1.27 --- process_routes.c 1 Nov 2006 09:20:13 -0000 1.28 *************** *** 415,420 **** struct destination_n *previous_node = add_kernel_list; - assert(metric_counter < HOPCNT_MAX); - /* searching for all the items with metric equal to n */ for(destination_kernel = add_kernel_list; destination_kernel != NULL; ) --- 415,418 ---- From (spam-protected) Wed Nov 1 10:21:46 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 01 Nov 2006 09:21:46 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h, 1.50.2.1, 1.50.2.2 process_routes.c, 1.27, 1.27.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17149 Modified Files: Tag: olsrd_04 defs.h process_routes.c Log Message: Removed assertion on hopcount Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.50.2.1 retrieving revision 1.50.2.2 diff -C2 -d -r1.50.2.1 -r1.50.2.2 *** defs.h 4 Jan 2006 15:51:51 -0000 1.50.2.1 --- defs.h 1 Nov 2006 09:21:44 -0000 1.50.2.2 *************** *** 69,73 **** #endif - #define HOPCNT_MAX 32 /* maximum hops number */ #define MAXMESSAGESIZE 1500 /* max broadcast size */ #define UDP_IPV4_HDRSIZE 28 --- 69,72 ---- Index: process_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -C2 -d -r1.27 -r1.27.2.1 *** process_routes.c 30 May 2005 13:13:38 -0000 1.27 --- process_routes.c 1 Nov 2006 09:21:44 -0000 1.27.2.1 *************** *** 415,420 **** struct destination_n *previous_node = add_kernel_list; - assert(metric_counter < HOPCNT_MAX); - /* searching for all the items with metric equal to n */ for(destination_kernel = add_kernel_list; destination_kernel != NULL; ) --- 415,418 ---- From (spam-protected) Mon Nov 6 00:01:05 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:01:05 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.67.2.1,1.67.2.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31062 Modified Files: Tag: olsrd_04 Makefile Log Message: * added a convenience target similar to HEAD Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.67.2.1 retrieving revision 1.67.2.2 diff -C2 -d -r1.67.2.1 -r1.67.2.2 *** Makefile 4 Jan 2006 15:51:51 -0000 1.67.2.1 --- Makefile 5 Nov 2006 23:01:02 -0000 1.67.2.2 *************** *** 162,163 **** --- 162,164 ---- build_all: cfgparser olsrd libs install_all: install install_libs + clean_all: uberclean clean_libs From (spam-protected) Mon Nov 6 00:02:49 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:02:49 +0000 Subject: [Olsr-cvs] olsrd-current .cvsignore,NONE,1.1.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31898 Added Files: Tag: olsrd_04 .cvsignore Log Message: * avoid useless output on "cvs update" --- NEW FILE: .cvsignore --- olsrd *.d From (spam-protected) Mon Nov 6 00:03:28 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:28 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.57, 1.57.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32293/lib/httpinfo/src Modified Files: Tag: olsrd_04 olsrd_httpinfo.c Log Message: * killed file descriptor leaks Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.57 retrieving revision 1.57.2.1 diff -C2 -d -r1.57 -r1.57.2.1 *** olsrd_httpinfo.c 22 Dec 2005 15:06:52 -0000 1.57 --- olsrd_httpinfo.c 5 Nov 2006 23:03:26 -0000 1.57.2.1 *************** *** 298,301 **** --- 298,302 ---- { olsr_printf(1, "(HTTPINFO) bind failed %s\n", strerror(errno)); + close(s); return -1; } *************** *** 305,308 **** --- 306,310 ---- { olsr_printf(1, "(HTTPINFO) listen failed %s\n", strerror(errno)); + close(s); return -1; } From (spam-protected) Mon Nov 6 00:03:28 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:28 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd net.c,1.26,1.26.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32293/src/bsd Modified Files: Tag: olsrd_04 net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -C2 -d -r1.26 -r1.26.2.1 *** net.c 28 Aug 2005 19:30:29 -0000 1.26 --- net.c 5 Nov 2006 23:03:26 -0000 1.26.2.1 *************** *** 291,294 **** --- 291,295 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 299,302 **** --- 300,304 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + close(sock); return (-1); } *************** *** 333,336 **** --- 335,339 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 340,343 **** --- 343,347 ---- { perror("SO_REUSEPORT failed"); + close(sock); return (-1); } *************** *** 346,349 **** --- 350,354 ---- { perror("IP_RECVIF failed"); + close(sock); return (-1); } *************** *** 404,407 **** --- 409,413 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } From (spam-protected) Mon Nov 6 00:03:29 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:29 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 net.c,1.19,1.19.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32293/src/win32 Modified Files: Tag: olsrd_04 net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/net.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** net.c 30 May 2005 13:50:27 -0000 1.19 --- net.c 5 Nov 2006 23:03:26 -0000 1.19.2.1 *************** *** 88,91 **** --- 88,92 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + closesocket(sock); return (-1); } From (spam-protected) Mon Nov 6 00:03:28 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:28 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux net.c,1.29,1.29.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32293/src/linux Modified Files: Tag: olsrd_04 net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/net.c,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -C2 -d -r1.29 -r1.29.2.1 *** net.c 17 Sep 2005 20:48:50 -0000 1.29 --- net.c 5 Nov 2006 23:03:26 -0000 1.29.2.1 *************** *** 435,438 **** --- 435,439 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 443,446 **** --- 444,448 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + close(sock); return (-1); } *************** *** 488,491 **** --- 490,494 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 521,524 **** --- 524,528 ---- fprintf(stderr, "Could not bind socket to device... exiting!\n\n"); syslog(LOG_ERR, "Could not bind socket to device... exiting!\n\n"); + close(sock); return -1; } *************** *** 607,610 **** --- 611,615 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 620,623 **** --- 625,629 ---- fprintf(stderr, "Could not bind socket to device... exiting!\n\n"); syslog(LOG_ERR, "Could not bind socket to device... exiting!\n\n"); + close(sock); return -1; } From (spam-protected) Mon Nov 6 00:03:58 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 net.c,1.19,1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32294/src/win32 Modified Files: net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/net.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** net.c 30 May 2005 13:50:27 -0000 1.19 --- net.c 5 Nov 2006 23:03:56 -0000 1.20 *************** *** 88,91 **** --- 88,92 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + closesocket(sock); return (-1); } From (spam-protected) Mon Nov 6 00:03:58 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux net.c,1.30,1.31 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32294/src/linux Modified Files: net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/net.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** net.c 7 Jan 2006 08:16:24 -0000 1.30 --- net.c 5 Nov 2006 23:03:56 -0000 1.31 *************** *** 435,438 **** --- 435,439 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 443,446 **** --- 444,448 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + close(sock); return (-1); } *************** *** 488,491 **** --- 490,494 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 521,524 **** --- 524,528 ---- fprintf(stderr, "Could not bind socket to device... exiting!\n\n"); syslog(LOG_ERR, "Could not bind socket to device... exiting!\n\n"); + close(sock); return -1; } *************** *** 607,610 **** --- 611,615 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 620,623 **** --- 625,629 ---- fprintf(stderr, "Could not bind socket to device... exiting!\n\n"); syslog(LOG_ERR, "Could not bind socket to device... exiting!\n\n"); + close(sock); return -1; } From (spam-protected) Mon Nov 6 00:03:58 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:58 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.59, 1.60 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32294/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * killed file descriptor leaks Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** olsrd_httpinfo.c 18 Sep 2006 18:55:30 -0000 1.59 --- olsrd_httpinfo.c 5 Nov 2006 23:03:56 -0000 1.60 *************** *** 298,301 **** --- 298,302 ---- { olsr_printf(1, "(HTTPINFO) bind failed %s\n", strerror(errno)); + close(s); return -1; } *************** *** 305,308 **** --- 306,310 ---- { olsr_printf(1, "(HTTPINFO) listen failed %s\n", strerror(errno)); + close(s); return -1; } From (spam-protected) Mon Nov 6 00:03:58 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch main.c,1.22,1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32294/src/olsr_switch Modified Files: main.c Log Message: * killed file descriptor leaks Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/main.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** main.c 8 Nov 2005 17:05:23 -0000 1.22 --- main.c 5 Nov 2006 23:03:56 -0000 1.23 *************** *** 343,346 **** --- 343,347 ---- { printf("bind failed for socket: %s\n", strerror(errno)); + close(srv_socket); exit(0); } *************** *** 350,353 **** --- 351,355 ---- { printf("listen failed for socket: %s\n", strerror(errno)); + close(srv_socket); exit(0); } From (spam-protected) Mon Nov 6 00:03:58 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 05 Nov 2006 23:03:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd net.c,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32294/src/bsd Modified Files: net.c Log Message: * killed file descriptor leaks Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** net.c 7 Jan 2006 08:16:22 -0000 1.27 --- net.c 5 Nov 2006 23:03:56 -0000 1.28 *************** *** 291,294 **** --- 291,295 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 299,302 **** --- 300,304 ---- fprintf(stderr, "Error connecting %d - %s\n", errno, strerror(errno)); printf("connection refused\n"); + close(sock); return (-1); } *************** *** 333,336 **** --- 335,339 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } *************** *** 340,343 **** --- 343,347 ---- { perror("SO_REUSEPORT failed"); + close(sock); return (-1); } *************** *** 346,349 **** --- 350,354 ---- { perror("IP_RECVIF failed"); + close(sock); return (-1); } *************** *** 404,407 **** --- 409,413 ---- { perror("SO_REUSEADDR failed"); + close(sock); return (-1); } From (spam-protected) Tue Nov 7 00:40:43 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 06 Nov 2006 23:40:43 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.18,1.19 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5828/lib/secure/src Modified Files: olsrd_secure.c Log Message: * taking the address seems quite wrong if I'm looking at other usages of that macro Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** olsrd_secure.c 7 Jan 2006 08:17:44 -0000 1.18 --- olsrd_secure.c 6 Nov 2006 23:40:41 -0000 1.19 *************** *** 953,957 **** { /* Check configuration timeout */ ! if(!TIMED_OUT(&entry->conftime)) { /* If registered - do not accept! */ --- 953,957 ---- { /* Check configuration timeout */ ! if(!TIMED_OUT(entry->conftime)) { /* If registered - do not accept! */ From (spam-protected) Tue Nov 7 00:40:42 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 06 Nov 2006 23:40:42 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c, 1.17, 1.17.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5822/lib/secure/src Modified Files: Tag: olsrd_04 olsrd_secure.c Log Message: * taking the address seems quite wrong if I'm looking at other usages of that macro Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** olsrd_secure.c 19 Nov 2005 08:37:23 -0000 1.17 --- olsrd_secure.c 6 Nov 2006 23:40:40 -0000 1.17.2.1 *************** *** 953,957 **** { /* Check configuration timeout */ ! if(!TIMED_OUT(&entry->conftime)) { /* If registered - do not accept! */ --- 953,957 ---- { /* Check configuration timeout */ ! if(!TIMED_OUT(entry->conftime)) { /* If registered - do not accept! */ From (spam-protected) Tue Nov 7 00:46:49 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 06 Nov 2006 23:46:49 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.19,1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10626/lib/secure/src Modified Files: olsrd_secure.c Log Message: * and naother instance Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** olsrd_secure.c 6 Nov 2006 23:40:41 -0000 1.19 --- olsrd_secure.c 6 Nov 2006 23:46:47 -0000 1.20 *************** *** 1206,1210 **** { /*Check if the entry is timed out*/ ! if((TIMED_OUT(&tmp_list->valtime)) && (TIMED_OUT(&tmp_list->conftime))) { entry_to_delete = tmp_list; --- 1206,1210 ---- { /*Check if the entry is timed out*/ ! if((TIMED_OUT(tmp_list->valtime)) && (TIMED_OUT(tmp_list->conftime))) { entry_to_delete = tmp_list; From (spam-protected) Tue Nov 7 00:46:50 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 06 Nov 2006 23:46:50 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c, 1.17.2.1, 1.17.2.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10637/lib/secure/src Modified Files: Tag: olsrd_04 olsrd_secure.c Log Message: * and naother instance Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** olsrd_secure.c 6 Nov 2006 23:40:40 -0000 1.17.2.1 --- olsrd_secure.c 6 Nov 2006 23:46:48 -0000 1.17.2.2 *************** *** 1206,1210 **** { /*Check if the entry is timed out*/ ! if((TIMED_OUT(&tmp_list->valtime)) && (TIMED_OUT(&tmp_list->conftime))) { entry_to_delete = tmp_list; --- 1206,1210 ---- { /*Check if the entry is timed out*/ ! if((TIMED_OUT(tmp_list->valtime)) && (TIMED_OUT(tmp_list->conftime))) { entry_to_delete = tmp_list; From (spam-protected) Sun Nov 12 22:54:55 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 12 Nov 2006 21:54:55 +0000 Subject: [Olsr-cvs] olsrd-current/gui/linux-gtk Makefile,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/gui/linux-gtk In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11591/gui/linux-gtk Modified Files: Makefile Log Message: * applied olsrd-0.4.10-paths.diff Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/gui/linux-gtk/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 24 Jun 2006 15:40:52 -0000 1.4 --- Makefile 12 Nov 2006 21:54:53 -0000 1.5 *************** *** 16,18 **** install: ! cp ./olsrd-gui /usr/bin/ --- 16,19 ---- install: ! mkdir -p ${DESTDIR}/usr/bin ! cp ./olsrd-gui ${DESTDIR}/usr/bin/ From (spam-protected) Sun Nov 12 22:54:55 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 12 Nov 2006 21:54:55 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11591 Modified Files: Makefile.inc Log Message: * applied olsrd-0.4.10-paths.diff Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.inc 21 Oct 2006 21:24:46 -0000 1.4 --- Makefile.inc 12 Nov 2006 21:54:52 -0000 1.5 *************** *** 7,16 **** # target directories and names ! #INSTALL_PREFIX = ! SBINDIR = $(INSTALL_PREFIX)/usr/sbin ! ETCDIR = $(INSTALL_PREFIX)/etc ! LIBDIR = $(INSTALL_PREFIX)/usr/lib ! DOCDIR = $(INSTALL_PREFIX)/usr/share/doc ! MANDIR = $(INSTALL_PREFIX)/usr/share/man CFGFILE = $(ETCDIR)/olsrd.conf EXENAME = olsrd --- 7,16 ---- # target directories and names ! # DESTDIR = ! SBINDIR = $(DESTDIR)/usr/sbin ! ETCDIR = $(DESTDIR)/etc ! LIBDIR = $(DESTDIR)/usr/lib ! DOCDIR = $(DESTDIR)/usr/share/doc ! MANDIR = $(DESTDIR)/usr/share/man CFGFILE = $(ETCDIR)/olsrd.conf EXENAME = olsrd From (spam-protected) Sun Nov 12 22:54:55 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 12 Nov 2006 21:54:55 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.fbsd, 1.8, 1.9 Makefile.linux, 1.7, 1.8 Makefile.nbsd, 1.5, 1.6 Makefile.obsd, 1.4, 1.5 Makefile.osx, 1.6, 1.7 Makefile.win32, 1.6, 1.7 Makefile.wince, 1.3, 1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11591/make Modified Files: Makefile.fbsd Makefile.linux Makefile.nbsd Makefile.obsd Makefile.osx Makefile.win32 Makefile.wince Log Message: * applied olsrd-0.4.10-paths.diff Index: Makefile.obsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.obsd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.obsd 21 Oct 2006 21:24:46 -0000 1.4 --- Makefile.obsd 12 Nov 2006 21:54:53 -0000 1.5 *************** *** 3,8 **** # ! INSTALL_PREFIX ?= ! LIBDIR = $(INSTALL_PREFIX)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) --- 3,8 ---- # ! DESTDIR ?= ! LIBDIR = $(DESTDIR)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) Index: Makefile.wince =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.wince,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.wince 21 Oct 2006 21:24:46 -0000 1.3 --- Makefile.wince 12 Nov 2006 21:54:53 -0000 1.4 *************** *** 3,8 **** # ! INSTALL_PREFIX ?= ! LIBDIR = $(INSTALL_PREFIX)/usr/lib SRCS += $(wildcard src/win32/*.c) --- 3,8 ---- # ! DESTDIR ?= ! LIBDIR = $(DESTDIR)/usr/lib SRCS += $(wildcard src/win32/*.c) Index: Makefile.win32 =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.win32,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.win32 21 Oct 2006 21:24:46 -0000 1.6 --- Makefile.win32 12 Nov 2006 21:54:53 -0000 1.7 *************** *** 3,7 **** # ! INSTALL_PREFIX ?= EXENAME = olsrd.exe --- 3,7 ---- # ! DESTDIR ?= EXENAME = olsrd.exe Index: Makefile.linux =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.linux,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.linux 21 Oct 2006 21:24:46 -0000 1.7 --- Makefile.linux 12 Nov 2006 21:54:53 -0000 1.8 *************** *** 3,12 **** # ! INSTALL_PREFIX ?= ! ifeq ($(shell arch),x86_64) ! LIBDIR = $(INSTALL_PREFIX)/usr/lib64 ! else ! LIBDIR = $(INSTALL_PREFIX)/usr/lib ! endif SRCS += $(wildcard src/linux/*.c) $(wildcard src/unix/*.c) --- 3,9 ---- # ! ARCH := $(shell uname -m) ! DESTDIR ?= ! LIBDIR = $(DESTDIR)$(shell [ "$(ARCH)" = "x86_64" && -d "/usr/lib64" ] && echo "/usr/lib64" || echo "/usr/lib") SRCS += $(wildcard src/linux/*.c) $(wildcard src/unix/*.c) *************** *** 23,27 **** GENERATE_PIC = true endif ! ifeq ($(shell arch),x86_64) GENERATE_PIC = true endif --- 20,24 ---- GENERATE_PIC = true endif ! ifeq ($(ARCH),x86_64) GENERATE_PIC = true endif Index: Makefile.osx =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.osx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.osx 21 Oct 2006 21:24:46 -0000 1.6 --- Makefile.osx 12 Nov 2006 21:54:53 -0000 1.7 *************** *** 7,12 **** STRIP = \# ! INSTALL_PREFIX ?= ! LIBDIR = $(INSTALL_PREFIX)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) --- 7,12 ---- STRIP = \# ! DESTDIR ?= ! LIBDIR = $(DESTDIR)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) Index: Makefile.fbsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.fbsd,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.fbsd 21 Oct 2006 21:24:46 -0000 1.8 --- Makefile.fbsd 12 Nov 2006 21:54:53 -0000 1.9 *************** *** 3,12 **** # ! INSTALL_PREFIX ?= /usr/local ! SBINDIR = $(INSTALL_PREFIX)/sbin ! ETCDIR = $(INSTALL_PREFIX)/etc ! LIBDIR = $(INSTALL_PREFIX)/lib ! DOCDIR = $(INSTALL_PREFIX)/share/doc ! MANDIR = $(INSTALL_PREFIX)/man SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) --- 3,12 ---- # ! DESTDIR ?= /usr/local ! SBINDIR = $(DESTDIR)/sbin ! ETCDIR = $(DESTDIR)/etc ! LIBDIR = $(DESTDIR)/lib ! DOCDIR = $(DESTDIR)/share/doc ! MANDIR = $(DESTDIR)/man SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) *************** *** 23,28 **** ifdef LIBNET ! CFLAGS += -DSPOOF -I$(INSTALL_PREFIX)/include ! LIBS += -L$(INSTALL_PREFIX)/lib -lnet endif --- 23,28 ---- ifdef LIBNET ! CFLAGS += -DSPOOF -I$(DESTDIR)/include ! LIBS += -L$(DESTDIR)/lib -lnet endif Index: Makefile.nbsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.nbsd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.nbsd 21 Oct 2006 21:24:46 -0000 1.5 --- Makefile.nbsd 12 Nov 2006 21:54:53 -0000 1.6 *************** *** 3,8 **** # ! INSTALL_PREFIX ?= ! LIBDIR = $(INSTALL_PREFIX)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) --- 3,8 ---- # ! DESTDIR ?= ! LIBDIR = $(DESTDIR)/usr/lib SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) From (spam-protected) Wed Nov 15 21:58:53 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 15 Nov 2006 20:58:53 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c, 1.14, 1.15 net_olsr.h, 1.3, 1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2091/src Modified Files: net_olsr.c net_olsr.h Log Message: Cleanup: * added "void" to function definitions if they have no parameter * made locally used only "netbufs" array "static". * moved locally only struct definitions into the .c file * added "const" to constant arrays * fixed typos Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** net_olsr.c 2 Oct 2006 08:37:17 -0000 1.14 --- net_olsr.c 15 Nov 2006 20:58:51 -0000 1.15 *************** *** 53,56 **** --- 53,57 ---- #endif + extern olsr_bool lq_tc_pending; *************** *** 65,68 **** --- 66,88 ---- + struct deny_address_entry + { + union olsr_ip_addr addr; + struct deny_address_entry *next; + }; + + + /* Output buffer structure */ + + struct olsr_netbuf + { + char *buff; /* Pointer to the allocated buffer */ + int if_index; + int bufsize; /* Size of the buffer */ + int maxsize; /* Max bytes of payload that can be added to the buffer */ + int pending; /* How much data is currently pending in the buffer */ + int reserved; /* Plugins can reserve space in buffers */ + }; + /* Packet transform functions */ *************** *** 75,79 **** static struct ptf *ptf_list; ! struct olsr_netbuf *netbufs[MAX_IFS]; static char ipv6_buf[100]; /* for address coversion */ --- 95,99 ---- static struct ptf *ptf_list; ! static struct olsr_netbuf *netbufs[MAX_IFS]; static char ipv6_buf[100]; /* for address coversion */ *************** *** 81,85 **** static struct deny_address_entry *deny_entries; ! static char *deny_ipv4_defaults[] = { "0.0.0.0", --- 101,105 ---- static struct deny_address_entry *deny_entries; ! static const char * const deny_ipv4_defaults[] = { "0.0.0.0", *************** *** 89,93 **** }; ! static char *deny_ipv6_defaults[] = { "0::0", --- 109,113 ---- }; ! static const char * const deny_ipv6_defaults[] = { "0::0", *************** *** 103,107 **** char * ! get_libnet_errbuf() { return errbuf; --- 123,127 ---- char * ! get_libnet_errbuf(void) { return errbuf; *************** *** 117,121 **** void ! init_net() { union olsr_ip_addr addr; --- 137,141 ---- void ! init_net(void) { union olsr_ip_addr addr; *************** *** 684,688 **** /* *if the -dispout option was given ! *we print the contetnt of the packets */ if(disp_pack_out) --- 704,708 ---- /* *if the -dispout option was given ! *we print the content of the packets */ if(disp_pack_out) Index: net_olsr.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** net_olsr.h 7 Jan 2006 08:16:20 -0000 1.3 --- net_olsr.h 15 Nov 2006 20:58:51 -0000 1.4 *************** *** 50,72 **** #include - struct deny_address_entry - { - union olsr_ip_addr addr; - struct deny_address_entry *next; - }; - - - /* Output buffer structure */ - - struct olsr_netbuf - { - char *buff; /* Pointer to the allocated buffer */ - int if_index; - int bufsize; /* Size of the buffer */ - int maxsize; /* Max bytes of payload that can be added to the buffer */ - int pending; /* How much data is currently pending in the buffer */ - int reserved; /* Plugins can reserve space in buffers */ - }; - #ifdef USE_LIBNET char * --- 50,53 ---- From (spam-protected) Wed Nov 15 22:13:54 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 15 Nov 2006 21:13:54 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.h, 1.4, 1.5 net_olsr.c, 1.15, 1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8349/src Modified Files: net_olsr.h net_olsr.c Log Message: * Created a typedef for the packet-transfromation-function. It is easier to parse (at least IMHO) than the "int (*)(char *, int *)" all over the place. * simplified the source in net_outbuffer_bytes_left() without changing the semantics. Either this is correct or it should have been different before. * reduced duplicated code in del_ptf() Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** net_olsr.c 15 Nov 2006 20:58:51 -0000 1.15 --- net_olsr.c 15 Nov 2006 21:13:52 -0000 1.16 *************** *** 89,93 **** struct ptf { ! int (*function)(char *, int *); struct ptf *next; }; --- 89,93 ---- struct ptf { ! packet_transform_function function; struct ptf *next; }; *************** *** 350,361 **** net_outbuffer_bytes_left(struct interface *ifp) { - int remaining; - if(!netbufs[ifp->if_nr]) return 0; ! remaining = netbufs[ifp->if_nr]->maxsize - netbufs[ifp->if_nr]->pending; ! ! return remaining ? remaining : 0; } --- 350,357 ---- net_outbuffer_bytes_left(struct interface *ifp) { if(!netbufs[ifp->if_nr]) return 0; ! return netbufs[ifp->if_nr]->maxsize - netbufs[ifp->if_nr]->pending; } *************** *** 370,374 **** */ int ! add_ptf(int (*f)(char *, int *)) { --- 366,370 ---- */ int ! add_ptf(packet_transform_function f) { *************** *** 394,398 **** */ int ! del_ptf(int (*f)(char *, int *)) { struct ptf *tmp_ptf, *prev; --- 390,394 ---- */ int ! del_ptf(packet_transform_function f) { struct ptf *tmp_ptf, *prev; *************** *** 407,419 **** /* Remove entry */ if(prev == NULL) - { ptf_list = tmp_ptf->next; - free(tmp_ptf); - } else - { prev->next = tmp_ptf->next; ! free(tmp_ptf); ! } return 1; } --- 403,410 ---- /* Remove entry */ if(prev == NULL) ptf_list = tmp_ptf->next; else prev->next = tmp_ptf->next; ! free(tmp_ptf); return 1; } Index: net_olsr.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** net_olsr.h 15 Nov 2006 20:58:51 -0000 1.4 --- net_olsr.h 15 Nov 2006 21:13:52 -0000 1.5 *************** *** 50,53 **** --- 50,55 ---- #include + typedef int (*packet_transform_function)(char *, int *); + #ifdef USE_LIBNET char * *************** *** 107,114 **** int ! add_ptf(int (*)(char *, int *)); int ! del_ptf(int (*f)(char *, int *)); olsr_bool --- 109,116 ---- int ! add_ptf(packet_transform_function); int ! del_ptf(packet_transform_function); olsr_bool From (spam-protected) Wed Nov 15 23:09:18 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 15 Nov 2006 22:09:18 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.72,1.73 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32035 Modified Files: Makefile Log Message: * fixed a forgotten INSTALL_PREFIX Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Makefile 28 Oct 2006 14:21:26 -0000 1.72 --- Makefile 15 Nov 2006 22:09:16 -0000 1.73 *************** *** 92,96 **** install_olsrd: install_bin @echo ========= C O N F I G U R A T I O N - F I L E ============ ! @echo olsrd uses the configfile $(INSTALL_PREFIX)/etc/olsr.conf @echo a default configfile. A sample RFC-compliance aimed @echo configfile can be installed. Note that a LQ-based configfile --- 92,96 ---- install_olsrd: install_bin @echo ========= C O N F I G U R A T I O N - F I L E ============ ! @echo olsrd uses the configfile $(DESTDIR)/etc/olsr.conf @echo a default configfile. A sample RFC-compliance aimed @echo configfile can be installed. Note that a LQ-based configfile From (spam-protected) Thu Nov 16 00:08:01 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 15 Nov 2006 23:08:01 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h, 1.53, 1.54 interfaces.h, 1.34, 1.35 net_olsr.c, 1.16, 1.17 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19540/src Modified Files: defs.h interfaces.h net_olsr.c Log Message: I removed the hardcoded (and BTW never checked) limit on 16 interfaces: We do this by adding the "struct netbuf" to the "struct interface" because - we avoid maintaining a separate array of pointers and malloc(3)ed struct's. - we avoid therefore lots of malloc(3) and free(3). - we need such a thing anyway for each interface, so why not put it in there (and libnet_ctx is also there). - we do not longer neeed the interface-index as a separate field. Does anyone know if the MTU of an interface may chnage (and if yes, when)? Otherwise we could get rid of another field in that struct (and a few lines of code). I compile-tested with `make build_all USE_LIBNET=1` but didn't run it. Downside: One must initialize this struct (or at least the pointer to the actual buffer). Therefore the one line change in src/unix/ifnet.c. Therefore I broke very probably the Windows port and I can' figure out if and where to add such an equivalent thing. Other changes: - The libnet_ctx field in struct interface is also in a #ifdef USE_LIBNET ... #endif section. Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** defs.h 1 Nov 2006 09:20:13 -0000 1.53 --- defs.h 15 Nov 2006 23:07:59 -0000 1.54 *************** *** 72,76 **** #define UDP_IPV4_HDRSIZE 28 #define UDP_IPV6_HDRSIZE 48 - #define MAX_IFS 16 #define MIN_PACKET_SIZE(ver) (int)(sizeof(olsr_u8_t) * ((ver == AF_INET) ? 4 : 7)) --- 72,75 ---- Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** net_olsr.c 15 Nov 2006 21:13:52 -0000 1.16 --- net_olsr.c 15 Nov 2006 23:07:59 -0000 1.17 *************** *** 73,88 **** - /* Output buffer structure */ - - struct olsr_netbuf - { - char *buff; /* Pointer to the allocated buffer */ - int if_index; - int bufsize; /* Size of the buffer */ - int maxsize; /* Max bytes of payload that can be added to the buffer */ - int pending; /* How much data is currently pending in the buffer */ - int reserved; /* Plugins can reserve space in buffers */ - }; - /* Packet transform functions */ --- 73,76 ---- *************** *** 95,100 **** static struct ptf *ptf_list; - static struct olsr_netbuf *netbufs[MAX_IFS]; - static char ipv6_buf[100]; /* for address coversion */ --- 83,86 ---- *************** *** 187,213 **** net_add_buffer(struct interface *ifp) { ! struct olsr_netbuf *new_buf; ! ! /* If a buffer already exists for this interface back off */ ! if(netbufs[ifp->if_nr]) ! return -1; ! ! new_buf = olsr_malloc(sizeof(struct olsr_netbuf), "add_netbuff1"); ! new_buf->buff = olsr_malloc(ifp->int_mtu, "add_netbuff2"); /* Fill struct */ ! new_buf->bufsize = ifp->int_mtu; ! new_buf->if_index = ifp->if_nr; ! new_buf->maxsize = ifp->int_mtu - OLSR_HEADERSIZE; ! ! new_buf->pending = 0; ! new_buf->reserved = 0; ! netbufs[ifp->if_nr] = new_buf; return 0; } - /** * Remove a outputbuffer. Frees the allocated memory. --- 173,198 ---- net_add_buffer(struct interface *ifp) { ! /* Can the interfaces MTU actually change? If not, we can elimiate ! * the "bufsize" field in "struct olsr_netbuf". ! */ ! if (ifp->netbuf.bufsize != ifp->int_mtu && ifp->netbuf.buff != NULL) { ! free(ifp->netbuf.buff); ! ifp->netbuf.buff = NULL; ! } ! ! if (ifp->netbuf.buff == NULL) { ! ifp->netbuf.buff = olsr_malloc(ifp->int_mtu, "add_netbuff"); ! } /* Fill struct */ ! ifp->netbuf.bufsize = ifp->int_mtu; ! ifp->netbuf.maxsize = ifp->int_mtu - OLSR_HEADERSIZE; ! ifp->netbuf.pending = 0; ! ifp->netbuf.reserved = 0; return 0; } /** * Remove a outputbuffer. Frees the allocated memory. *************** *** 221,236 **** net_remove_buffer(struct interface *ifp) { - - /* If a buffer does no exist for this interface back off */ - if(!netbufs[ifp->if_nr]) - return -1; - /* Flush pending data */ ! if(netbufs[ifp->if_nr]->pending) net_output(ifp); ! free(netbufs[ifp->if_nr]->buff); ! free(netbufs[ifp->if_nr]); ! netbufs[ifp->if_nr] = NULL; return 0; --- 206,215 ---- net_remove_buffer(struct interface *ifp) { /* Flush pending data */ ! if(ifp->netbuf.pending) net_output(ifp); ! free(ifp->netbuf.buff); ! ifp->netbuf.buff = NULL; return 0; *************** *** 238,242 **** - /** * Reserve space in a outputbuffer. This should only be needed --- 217,220 ---- *************** *** 256,264 **** net_reserve_bufspace(struct interface *ifp, int size) { ! if((!netbufs[ifp->if_nr]) || (size > netbufs[ifp->if_nr]->maxsize)) return -1; ! netbufs[ifp->if_nr]->reserved = size; ! netbufs[ifp->if_nr]->maxsize -= size; return 0; --- 234,242 ---- net_reserve_bufspace(struct interface *ifp, int size) { ! if(size > ifp->netbuf.maxsize) return -1; ! ifp->netbuf.reserved = size; ! ifp->netbuf.maxsize -= size; return 0; *************** *** 276,283 **** net_output_pending(struct interface *ifp) { ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! return netbufs[ifp->if_nr]->pending; } --- 254,258 ---- net_output_pending(struct interface *ifp) { ! return ifp->netbuf.pending; } *************** *** 298,310 **** net_outbuffer_push(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if((netbufs[ifp->if_nr]->pending + size) > netbufs[ifp->if_nr]->maxsize) return 0; ! memcpy(&netbufs[ifp->if_nr]->buff[netbufs[ifp->if_nr]->pending + OLSR_HEADERSIZE], data, size); ! netbufs[ifp->if_nr]->pending += size; return size; --- 273,281 ---- net_outbuffer_push(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! if((ifp->netbuf.pending + size) > ifp->netbuf.maxsize) return 0; ! memcpy(&ifp->netbuf.buff[ifp->netbuf.pending + OLSR_HEADERSIZE], data, size); ! ifp->netbuf.pending += size; return size; *************** *** 326,338 **** net_outbuffer_push_reserved(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if((netbufs[ifp->if_nr]->pending + size) > (netbufs[ifp->if_nr]->maxsize + netbufs[ifp->if_nr]->reserved)) return 0; ! memcpy(&netbufs[ifp->if_nr]->buff[netbufs[ifp->if_nr]->pending + OLSR_HEADERSIZE], data, size); ! netbufs[ifp->if_nr]->pending += size; return size; --- 297,305 ---- net_outbuffer_push_reserved(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! if((ifp->netbuf.pending + size) > (ifp->netbuf.maxsize + ifp->netbuf.reserved)) return 0; ! memcpy(&ifp->netbuf.buff[ifp->netbuf.pending + OLSR_HEADERSIZE], data, size); ! ifp->netbuf.pending += size; return size; *************** *** 350,357 **** net_outbuffer_bytes_left(struct interface *ifp) { ! if(!netbufs[ifp->if_nr]) ! return 0; ! ! return netbufs[ifp->if_nr]->maxsize - netbufs[ifp->if_nr]->pending; } --- 317,321 ---- net_outbuffer_bytes_left(struct interface *ifp) { ! return ifp->netbuf.maxsize - ifp->netbuf.pending; } *************** *** 457,462 **** int net_output(struct interface *ifp) - #ifdef USE_LIBNET { struct ptf *tmp_ptf_list; union olsr_packet *outmsg; --- 421,426 ---- int net_output(struct interface *ifp) { + #ifdef USE_LIBNET struct ptf *tmp_ptf_list; union olsr_packet *outmsg; *************** *** 464,484 **** libnet_ptag_t udp_ptag = 0, ip_ptag = 0; ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if(!netbufs[ifp->if_nr]->pending) return 0; assert(ifp->libnet_ctx != NULL); ! netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE; ! retval = netbufs[ifp->if_nr]->pending; ! outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(netbufs[ifp->if_nr]->pending); /* --- 428,445 ---- libnet_ptag_t udp_ptag = 0, ip_ptag = 0; ! if(!ifp->netbuf.pending) return 0; assert(ifp->libnet_ctx != NULL); ! ifp->netbuf.pending += OLSR_HEADERSIZE; ! retval = ifp->netbuf.pending; ! outmsg = (union olsr_packet *)ifp->netbuf.buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(ifp->netbuf.pending); /* *************** *** 488,492 **** while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(netbufs[ifp->if_nr]->buff, &netbufs[ifp->if_nr]->pending); tmp_ptf_list = tmp_ptf_list->next; } --- 449,453 ---- while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending); tmp_ptf_list = tmp_ptf_list->next; } *************** *** 497,512 **** */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, &ifp->ip_addr); printf("LIBNET TX %d bytes on %s\n", ! netbufs[ifp->if_nr]->pending, ifp->int_name); udp_ptag = libnet_build_udp(OLSRPORT, OLSRPORT, ! LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, 0, ! (u_int8_t *)netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, ifp->libnet_ctx, 0); --- 458,473 ---- */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ! ifp->netbuf.pending, &ifp->ip_addr); printf("LIBNET TX %d bytes on %s\n", ! ifp->netbuf.pending, ifp->int_name); udp_ptag = libnet_build_udp(OLSRPORT, OLSRPORT, ! LIBNET_UDP_H + ifp->netbuf.pending, 0, ! (u_int8_t *)ifp->netbuf.buff, ! ifp->netbuf.pending, ifp->libnet_ctx, 0); *************** *** 515,519 **** { OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; --- 476,480 ---- { OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! ifp->netbuf.pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; *************** *** 523,527 **** { /* IP version 4 */ ! ip_ptag = libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, olsr_cnf->tos, ifp->olsr_seqnum, --- 484,488 ---- { /* IP version 4 */ ! ip_ptag = libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_UDP_H + ifp->netbuf.pending, olsr_cnf->tos, ifp->olsr_seqnum, *************** *** 539,543 **** { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; --- 500,504 ---- { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! ifp->netbuf.pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; *************** *** 570,577 **** printf("Build IPv6 size: %d\n", ! LIBNET_IPV6_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); ip_ptag = libnet_build_ipv6(0, /* Traffic class */ 0, /* Flow label */ ! LIBNET_IPV6_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, IPPROTO_UDP, /* Next Header */ 64, /* Hop Limit */ --- 531,538 ---- printf("Build IPv6 size: %d\n", ! LIBNET_IPV6_H + LIBNET_UDP_H + ifp->netbuf.pending); ip_ptag = libnet_build_ipv6(0, /* Traffic class */ 0, /* Flow label */ ! LIBNET_IPV6_H + LIBNET_UDP_H + ifp->netbuf.pending, IPPROTO_UDP, /* Next Header */ 64, /* Hop Limit */ *************** *** 586,590 **** { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; --- 547,551 ---- { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! ifp->netbuf.pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; *************** *** 595,599 **** { libnet_ptag_t ether_tag = 0; ! unsigned char enet_broadcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /* We should add layer2 as well later */ --- 556,560 ---- { libnet_ptag_t ether_tag = 0; ! static const unsigned char enet_broadcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /* We should add layer2 as well later */ *************** *** 608,612 **** { OLSR_PRINTF (1, "libnet ethernet header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; --- 569,573 ---- { OLSR_PRINTF (1, "libnet ethernet header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! ifp->netbuf.pending = 0; libnet_clear_packet(ifp->libnet_ctx); return -1; *************** *** 623,638 **** libnet_clear_packet(ifp->libnet_ctx); ! netbufs[ifp->if_nr]->pending = 0; ! ! // if we've just transmitted a TC message, let Dijkstra use the current ! // link qualities for the links to our neighbours ! ! olsr_update_dijkstra_link_qualities(); ! lq_tc_pending = OLSR_FALSE; ! ! return retval; ! } #else - { struct sockaddr_in *sin; struct sockaddr_in dst; --- 584,589 ---- libnet_clear_packet(ifp->libnet_ctx); ! ifp->netbuf.pending = 0; #else struct sockaddr_in *sin; struct sockaddr_in dst; *************** *** 646,664 **** sin6 = NULL; ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if(!netbufs[ifp->if_nr]->pending) return 0; ! netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE; ! retval = netbufs[ifp->if_nr]->pending; ! outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(netbufs[ifp->if_nr]->pending); if(olsr_cnf->ip_version == AF_INET) --- 597,612 ---- sin6 = NULL; ! if(!ifp->netbuf.pending) return 0; ! ifp->netbuf.pending += OLSR_HEADERSIZE; ! retval = ifp->netbuf.pending; ! outmsg = (union olsr_packet *)ifp->netbuf.buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(ifp->netbuf.pending); if(olsr_cnf->ip_version == AF_INET) *************** *** 689,693 **** while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(netbufs[ifp->if_nr]->buff, &netbufs[ifp->if_nr]->pending); tmp_ptf_list = tmp_ptf_list->next; } --- 637,641 ---- while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending); tmp_ptf_list = tmp_ptf_list->next; } *************** *** 698,703 **** */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, &ifp->ip_addr); if(olsr_cnf->ip_version == AF_INET) --- 646,651 ---- */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ! ifp->netbuf.pending, &ifp->ip_addr); if(olsr_cnf->ip_version == AF_INET) *************** *** 705,710 **** /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, ! netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, MSG_DONTROUTE, (struct sockaddr *)sin, --- 653,658 ---- /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, ! ifp->netbuf.buff, ! ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin, *************** *** 721,726 **** /* IP version 6 */ if(olsr_sendto(ifp->olsr_socket, ! netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, MSG_DONTROUTE, (struct sockaddr *)sin6, --- 669,674 ---- /* IP version 6 */ if(olsr_sendto(ifp->olsr_socket, ! ifp->netbuf.buff, ! ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, *************** *** 732,742 **** fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_nr); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); ! fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending); retval = -1; } } ! netbufs[ifp->if_nr]->pending = 0; ! // if we've just transmitted a TC message, let Dijkstra use the current // link qualities for the links to our neighbours --- 680,690 ---- fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_nr); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); ! fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending); retval = -1; } } ! ifp->netbuf.pending = 0; ! #endif // if we've just transmitted a TC message, let Dijkstra use the current // link qualities for the links to our neighbours *************** *** 747,751 **** return retval; } - #endif --- 695,698 ---- Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** interfaces.h 11 Oct 2006 20:58:45 -0000 1.34 --- interfaces.h 15 Nov 2006 23:07:59 -0000 1.35 *************** *** 108,111 **** --- 108,123 ---- }; + /* Output buffer structure. This should actually be in net_olsr.h but we have circular references then. + */ + struct olsr_netbuf + { + olsr_u8_t *buff;/* Pointer to the allocated buffer */ + int bufsize; /* Size of the buffer */ + int maxsize; /* Max bytes of payload that can be added to the buffer */ + int pending; /* How much data is currently pending in the buffer */ + int reserved; /* Plugins can reserve space in buffers */ + }; + + /** *A struct containing all necessary information about each *************** *** 139,143 **** --- 151,158 ---- clock_t fwdtimer; /* Timeout for OLSR forwarding on this if */ + #ifdef USE_LIBNET void *libnet_ctx; /* libnet context(void to avoid dependency */ + #endif + struct olsr_netbuf netbuf; /* the buffer to construct the packet data */ struct if_gen_property *gen_properties;/* Generic interface properties */ From (spam-protected) Thu Nov 16 00:08:01 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 15 Nov 2006 23:08:01 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.39,1.40 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19540/src/unix Modified Files: ifnet.c Log Message: I removed the hardcoded (and BTW never checked) limit on 16 interfaces: We do this by adding the "struct netbuf" to the "struct interface" because - we avoid maintaining a separate array of pointers and malloc(3)ed struct's. - we avoid therefore lots of malloc(3) and free(3). - we need such a thing anyway for each interface, so why not put it in there (and libnet_ctx is also there). - we do not longer neeed the interface-index as a separate field. Does anyone know if the MTU of an interface may chnage (and if yes, when)? Otherwise we could get rid of another field in that struct (and a few lines of code). I compile-tested with `make build_all USE_LIBNET=1` but didn't run it. Downside: One must initialize this struct (or at least the pointer to the actual buffer). Therefore the one line change in src/unix/ifnet.c. Therefore I broke very probably the Windows port and I can' figure out if and where to add such an equivalent thing. Other changes: - The libnet_ctx field in struct interface is also in a #ifdef USE_LIBNET ... #endif section. Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ifnet.c 11 Oct 2006 20:58:45 -0000 1.39 --- ifnet.c 15 Nov 2006 23:07:59 -0000 1.40 *************** *** 747,750 **** --- 747,751 ---- } + memset(&ifs.netbuf, 0, sizeof(struct olsr_netbuf)); ifs.int_flags = ifr.ifr_flags; *************** *** 917,921 **** --- 918,924 ---- memcpy(ifp, &ifs, sizeof(struct interface)); + #ifdef USE_LIBNET ifp->libnet_ctx = NULL; + #endif ifp->gen_properties = NULL; ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3"); From (spam-protected) Fri Nov 17 00:08:42 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 16 Nov 2006 23:08:42 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.c, 1.1, 1.1.2.1 defs.h, 1.50.2.2, 1.50.2.3 generate_msg.c, 1.23, 1.23.2.1 interfaces.h, 1.30.2.1, 1.30.2.2 lq_packet.c, 1.19, 1.19.2.1 net_olsr.c, 1.7, 1.7.2.1 net_olsr.h, 1.1, 1.1.2.1 olsr.c, 1.47, 1.47.2.1 scheduler.c, 1.33.2.1, 1.33.2.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16896 Modified Files: Tag: olsrd_04 defs.c defs.h generate_msg.c interfaces.h lq_packet.c net_olsr.c net_olsr.h olsr.c scheduler.c Log Message: * backported the deletion of MAX_IFS to the stable branch Index: defs.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/Attic/defs.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** defs.c 29 May 2005 12:47:45 -0000 1.1 --- defs.c 16 Nov 2006 23:08:39 -0000 1.1.2.1 *************** *** 37,42 **** float max_tc_vtime; - clock_t fwdtimer[MAX_IFS]; /* forwarding timer */ - int minsize; --- 37,40 ---- Index: net_olsr.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** net_olsr.h 25 May 2005 20:59:46 -0000 1.1 --- net_olsr.h 16 Nov 2006 23:08:39 -0000 1.1.2.1 *************** *** 57,72 **** - /* Output buffer structure */ - - struct olsr_netbuf - { - char *buff; /* Pointer to the allocated buffer */ - int if_index; - int bufsize; /* Size of the buffer */ - int maxsize; /* Max bytes of payload that can be added to the buffer */ - int pending; /* How much data is currently pending in the buffer */ - int reserved; /* Plugins can reserve space in buffers */ - }; - void init_net(void); --- 57,60 ---- Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.50.2.2 retrieving revision 1.50.2.3 diff -C2 -d -r1.50.2.2 -r1.50.2.3 *** defs.h 1 Nov 2006 09:21:44 -0000 1.50.2.2 --- defs.h 16 Nov 2006 23:08:39 -0000 1.50.2.3 *************** *** 72,76 **** #define UDP_IPV4_HDRSIZE 28 #define UDP_IPV6_HDRSIZE 48 - #define MAX_IFS 16 /* Debug helper macro */ --- 72,75 ---- *************** *** 167,172 **** extern float max_tc_vtime; - extern clock_t fwdtimer[MAX_IFS]; /* forwarding timer */ - extern int minsize; --- 166,169 ---- Index: lq_packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** lq_packet.c 17 Nov 2005 01:58:51 -0000 1.19 --- lq_packet.c 16 Nov 2006 23:08:39 -0000 1.19.2.1 *************** *** 783,787 **** destroy_lq_tc(&lq_tc); ! if(net_output_pending(outif) && TIMED_OUT(fwdtimer[outif->if_nr])) set_buffer_timer(outif); } --- 783,787 ---- destroy_lq_tc(&lq_tc); ! if(net_output_pending(outif) && TIMED_OUT(outif->fwdtimer)) set_buffer_timer(outif); } Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** net_olsr.c 29 Dec 2005 18:37:16 -0000 1.7 --- net_olsr.c 16 Nov 2006 23:08:39 -0000 1.7.2.1 *************** *** 67,72 **** static struct ptf *ptf_list; - struct olsr_netbuf *netbufs[MAX_IFS]; - static char ipv6_buf[100]; /* for address coversion */ --- 67,70 ---- *************** *** 140,161 **** net_add_buffer(struct interface *ifp) { ! struct olsr_netbuf *new_buf; ! ! /* If a buffer already exists for this interface back off */ ! if(netbufs[ifp->if_nr]) ! return -1; ! ! new_buf = olsr_malloc(sizeof(struct olsr_netbuf), "add_netbuff1"); ! new_buf->buff = olsr_malloc(ifp->int_mtu, "add_netbuff2"); ! ! /* Fill struct */ ! new_buf->bufsize = ifp->int_mtu; ! new_buf->if_index = ifp->if_nr; ! new_buf->maxsize = ifp->int_mtu - OLSR_HEADERSIZE; ! ! new_buf->pending = 0; ! new_buf->reserved = 0; ! netbufs[ifp->if_nr] = new_buf; return 0; --- 138,159 ---- net_add_buffer(struct interface *ifp) { ! /* Can the interfaces MTU actually change? If not, we can elimiate ! * the "bufsize" field in "struct olsr_netbuf". ! */ ! if (ifp->netbuf.bufsize != ifp->int_mtu && ifp->netbuf.buff != NULL) { ! free(ifp->netbuf.buff); ! ifp->netbuf.buff = NULL; ! } ! ! if (ifp->netbuf.buff == NULL) { ! ifp->netbuf.buff = olsr_malloc(ifp->int_mtu, "add_netbuff"); ! } ! /* Fill struct */ ! ifp->netbuf.bufsize = ifp->int_mtu; ! ifp->netbuf.maxsize = ifp->int_mtu - OLSR_HEADERSIZE; ! ! ifp->netbuf.pending = 0; ! ifp->netbuf.reserved = 0; return 0; *************** *** 174,189 **** net_remove_buffer(struct interface *ifp) { ! ! /* If a buffer does no exist for this interface back off */ ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! /* Flush pending data */ ! if(netbufs[ifp->if_nr]->pending) net_output(ifp); ! free(netbufs[ifp->if_nr]->buff); ! free(netbufs[ifp->if_nr]); ! netbufs[ifp->if_nr] = NULL; return 0; --- 172,180 ---- net_remove_buffer(struct interface *ifp) { ! if(ifp->netbuf.pending) net_output(ifp); ! free(ifp->netbuf.buff); ! ifp->netbuf.buff = NULL; return 0; *************** *** 209,217 **** net_reserve_bufspace(struct interface *ifp, int size) { ! if((!netbufs[ifp->if_nr]) || (size > netbufs[ifp->if_nr]->maxsize)) return -1; ! netbufs[ifp->if_nr]->reserved = size; ! netbufs[ifp->if_nr]->maxsize -= size; return 0; --- 200,208 ---- net_reserve_bufspace(struct interface *ifp, int size) { ! if(size > ifp->netbuf.maxsize) return -1; ! ifp->netbuf.reserved = size; ! ifp->netbuf.maxsize -= size; return 0; *************** *** 229,236 **** net_output_pending(struct interface *ifp) { ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! return netbufs[ifp->if_nr]->pending; } --- 220,224 ---- net_output_pending(struct interface *ifp) { ! return ifp->netbuf.pending; } *************** *** 251,263 **** net_outbuffer_push(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if((netbufs[ifp->if_nr]->pending + size) > netbufs[ifp->if_nr]->maxsize) return 0; ! ! memcpy(&netbufs[ifp->if_nr]->buff[netbufs[ifp->if_nr]->pending + OLSR_HEADERSIZE], data, size); ! netbufs[ifp->if_nr]->pending += size; return size; --- 239,247 ---- net_outbuffer_push(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! if((ifp->netbuf.pending + size) > ifp->netbuf.maxsize) return 0; ! ! memcpy(&ifp->netbuf.buff[ifp->netbuf.pending + OLSR_HEADERSIZE], data, size); ! ifp->netbuf.pending += size; return size; *************** *** 279,291 **** net_outbuffer_push_reserved(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if((netbufs[ifp->if_nr]->pending + size) > (netbufs[ifp->if_nr]->maxsize + netbufs[ifp->if_nr]->reserved)) return 0; ! ! memcpy(&netbufs[ifp->if_nr]->buff[netbufs[ifp->if_nr]->pending + OLSR_HEADERSIZE], data, size); ! netbufs[ifp->if_nr]->pending += size; return size; --- 263,271 ---- net_outbuffer_push_reserved(struct interface *ifp, olsr_u8_t *data, olsr_u16_t size) { ! if((ifp->netbuf.pending + size) > (ifp->netbuf.maxsize + ifp->netbuf.reserved)) return 0; ! ! memcpy(&ifp->netbuf.buff[ifp->netbuf.pending + OLSR_HEADERSIZE], data, size); ! ifp->netbuf.pending += size; return size; *************** *** 303,314 **** net_outbuffer_bytes_left(struct interface *ifp) { ! int remaining; ! ! if(!netbufs[ifp->if_nr]) ! return 0; ! ! remaining = netbufs[ifp->if_nr]->maxsize - netbufs[ifp->if_nr]->pending; ! ! return remaining ? remaining : 0; } --- 283,287 ---- net_outbuffer_bytes_left(struct interface *ifp) { ! return ifp->netbuf.maxsize - ifp->netbuf.pending; } *************** *** 400,416 **** sin6 = NULL; ! if(!netbufs[ifp->if_nr]) ! return -1; ! ! if(!netbufs[ifp->if_nr]->pending) return 0; ! netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE; ! ! outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(netbufs[ifp->if_nr]->pending); if(olsr_cnf->ip_version == AF_INET) --- 373,386 ---- sin6 = NULL; ! if(!ifp->netbuf.pending) return 0; ! ifp->netbuf.pending += OLSR_HEADERSIZE; ! ! outmsg = (union olsr_packet *)ifp->netbuf.buff; /* Add the Packet seqno */ outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); /* Set the packetlength */ ! outmsg->v4.olsr_packlen = htons(ifp->netbuf.pending); if(olsr_cnf->ip_version == AF_INET) *************** *** 441,445 **** while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(netbufs[ifp->if_nr]->buff, &netbufs[ifp->if_nr]->pending); tmp_ptf_list = tmp_ptf_list->next; } --- 411,415 ---- while(tmp_ptf_list != NULL) { ! tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending); tmp_ptf_list = tmp_ptf_list->next; } *************** *** 450,455 **** */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, &ifp->ip_addr); if(olsr_cnf->ip_version == AF_INET) --- 420,425 ---- */ if(disp_pack_out) ! print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ! ifp->netbuf.pending, &ifp->ip_addr); if(olsr_cnf->ip_version == AF_INET) *************** *** 457,462 **** /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, ! netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, MSG_DONTROUTE, (struct sockaddr *)sin, --- 427,432 ---- /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, ! ifp->netbuf.buff, ! ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin, *************** *** 466,470 **** perror("sendto(v4)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m"); ! netbufs[ifp->if_nr]->pending = 0; return -1; } --- 436,440 ---- perror("sendto(v4)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m"); ! ifp->netbuf.pending = 0; return -1; } *************** *** 474,479 **** /* IP version 6 */ if(olsr_sendto(ifp->olsr_socket, ! netbufs[ifp->if_nr]->buff, ! netbufs[ifp->if_nr]->pending, MSG_DONTROUTE, (struct sockaddr *)sin6, --- 444,449 ---- /* IP version 6 */ if(olsr_sendto(ifp->olsr_socket, ! ifp->netbuf.buff, ! ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, *************** *** 485,495 **** fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_nr); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); ! fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending); ! netbufs[ifp->if_nr]->pending = 0; return -1; } } ! netbufs[ifp->if_nr]->pending = 0; // if we've just transmitted a TC message, let Dijkstra use the current --- 455,465 ---- fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_nr); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); ! fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending); ! ifp->netbuf.pending = 0; return -1; } } ! ifp->netbuf.pending = 0; // if we've just transmitted a TC message, let Dijkstra use the current Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.30.2.1 retrieving revision 1.30.2.2 diff -C2 -d -r1.30.2.1 -r1.30.2.2 *** interfaces.h 17 Apr 2006 18:25:29 -0000 1.30.2.1 --- interfaces.h 16 Nov 2006 23:08:39 -0000 1.30.2.2 *************** *** 44,47 **** --- 44,48 ---- #define _OLSR_INTERFACE + #include #include #include *************** *** 107,110 **** --- 108,123 ---- }; + /* Output buffer structure. This should actually be in net_olsr.h but we have circular references then. + */ + struct olsr_netbuf + { + olsr_u8_t *buff;/* Pointer to the allocated buffer */ + int bufsize; /* Size of the buffer */ + int maxsize; /* Max bytes of payload that can be added to the buffer */ + int pending; /* How much data is currently pending in the buffer */ + int reserved; /* Plugins can reserve space in buffers */ + }; + + /** *A struct containing all necessary information about each *************** *** 136,139 **** --- 149,156 ---- struct vtimes valtimes; + clock_t fwdtimer; /* Timeout for OLSR forwarding on this if */ + + struct olsr_netbuf netbuf; /* the buffer to construct the packet data */ + struct if_gen_property *gen_properties;/* Generic interface properties */ Index: generate_msg.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/generate_msg.c,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** generate_msg.c 27 Feb 2005 18:39:43 -0000 1.23 --- generate_msg.c 16 Nov 2006 23:08:39 -0000 1.23.2.1 *************** *** 87,91 **** olsr_build_tc_packet(&tcpacket); ! if(queue_tc(&tcpacket, ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 87,91 ---- olsr_build_tc_packet(&tcpacket); ! if(queue_tc(&tcpacket, ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); *************** *** 100,104 **** struct interface *ifn = (struct interface *)p; ! if(queue_mid(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 100,104 ---- struct interface *ifn = (struct interface *)p; ! if(queue_mid(ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); *************** *** 114,118 **** struct interface *ifn = (struct interface *)p; ! if(queue_hna(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 114,118 ---- struct interface *ifn = (struct interface *)p; ! if(queue_hna(ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); Index: scheduler.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v retrieving revision 1.33.2.1 retrieving revision 1.33.2.2 diff -C2 -d -r1.33.2.1 -r1.33.2.2 *** scheduler.c 27 Jul 2006 15:57:47 -0000 1.33.2.1 --- scheduler.c 16 Nov 2006 23:08:39 -0000 1.33.2.2 *************** *** 198,202 **** for (ifn = ifnet; ifn ; ifn = ifn->int_next) { ! if(net_output_pending(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) net_output(ifn); } --- 198,202 ---- for (ifn = ifnet; ifn ; ifn = ifn->int_next) { ! if(net_output_pending(ifn) && TIMED_OUT(ifn->fwdtimer)) net_output(ifn); } Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.47 retrieving revision 1.47.2.1 diff -C2 -d -r1.47 -r1.47.2.1 *** olsr.c 17 Nov 2005 04:25:44 -0000 1.47 --- olsr.c 16 Nov 2006 23:08:39 -0000 1.47.2.1 *************** *** 430,434 **** jitter *= max_jitter; ! fwdtimer[ifn->if_nr] = GET_TIMESTAMP(jitter*1000); } --- 430,434 ---- jitter *= max_jitter; ! ifn->fwdtimer = GET_TIMESTAMP(jitter*1000); } From (spam-protected) Fri Nov 17 00:08:42 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 16 Nov 2006 23:08:42 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.31.2.3,1.31.2.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16896/unix Modified Files: Tag: olsrd_04 ifnet.c Log Message: * backported the deletion of MAX_IFS to the stable branch Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.31.2.3 retrieving revision 1.31.2.4 diff -C2 -d -r1.31.2.3 -r1.31.2.4 *** ifnet.c 17 Apr 2006 18:25:30 -0000 1.31.2.3 --- ifnet.c 16 Nov 2006 23:08:40 -0000 1.31.2.4 *************** *** 737,740 **** --- 737,741 ---- } + memset(&ifs.netbuf, 0, sizeof(struct olsr_netbuf)); ifs.int_flags = ifr.ifr_flags; From (spam-protected) Sun Nov 26 01:32:16 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 26 Nov 2006 00:32:16 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux apm.c,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29341/src/linux Modified Files: apm.c Log Message: * Fixed a leaking FILE * * Since the "buffer" variable can never be == NULL, I assume that it was meant actually that way. Index: apm.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/apm.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** apm.c 26 Oct 2006 22:02:56 -0000 1.15 --- apm.c 26 Nov 2006 00:32:14 -0000 1.16 *************** *** 191,203 **** return 0; ! ! fgets(buffer, sizeof(buffer) - 1, apm_procfile); ! if(buffer == NULL) { /* Try re-opening the file */ if((apm_procfile = fopen(APM_PROC, "r")) != NULL) return 0; ! fgets(buffer, sizeof(buffer) - 1, apm_procfile); ! if(buffer == NULL) { /* Giving up */ --- 191,202 ---- return 0; ! if(fgets(buffer, sizeof(buffer) - 1, apm_procfile) == NULL) { + fclose(apm_procfile); /* Try re-opening the file */ if((apm_procfile = fopen(APM_PROC, "r")) != NULL) return 0; ! ! if(fgets(buffer, sizeof(buffer) - 1, apm_procfile) == NULL) { /* Giving up */ From (spam-protected) Sun Nov 26 01:32:16 2006 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 26 Nov 2006 00:32:16 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux apm.c,1.14,1.14.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27853/src/linux Modified Files: Tag: olsrd_04 apm.c Log Message: * ANSI-C doesn't allow to compare pointers < (or >) NULL, only == NULL or != NULL. * Fixed a leaking FILE * * Since the "buffer" variable can never be == NULL, I assume that it was meant actually that way. Index: apm.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/apm.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** apm.c 7 Apr 2005 18:22:43 -0000 1.14 --- apm.c 26 Nov 2006 00:32:14 -0000 1.14.2.1 *************** *** 191,203 **** return 0; ! ! fgets(buffer, sizeof(buffer) - 1, apm_procfile); ! if(buffer == NULL) { /* Try re-opening the file */ ! if((apm_procfile = fopen(APM_PROC, "r")) < 0) return 0; ! fgets(buffer, sizeof(buffer) - 1, apm_procfile); ! if(buffer == NULL) { /* Giving up */ --- 191,201 ---- return 0; ! if(fgets(buffer, sizeof(buffer) - 1, apm_procfile) == NULL) { + fclose(apm_procfile); /* Try re-opening the file */ ! if((apm_procfile = fopen(APM_PROC, "r")) == NULL) return 0; ! if(fgets(buffer, sizeof(buffer) - 1, apm_procfile) == NULL) { /* Giving up */