[Olsr-cvs] olsrd-current/lib/quagga/src olsrd_plugin.c,1.9,1.10

Bernd Petrovitsch (spam-protected)
Thu Nov 29 01:18:56 CET 2007


Update of /cvsroot/olsrd/olsrd-current/lib/quagga/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5107/lib/quagga/src

Modified Files:
	olsrd_plugin.c 
Log Message:
Patch from Sven-Ola Tücke <(spam-protected)> from
http://download-master.berlin.freifunk.net/sven-ola/nylon/packages/olsrd/files/103-olsrd-rt-exportroute-cleanup.patch:
avoid a malloc()ed list of functions


Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/olsrd_plugin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** olsrd_plugin.c	8 Nov 2007 22:47:40 -0000	1.9
--- olsrd_plugin.c	29 Nov 2007 00:18:53 -0000	1.10
***************
*** 42,45 ****
--- 42,47 ----
  static set_plugin_parameter set_localpref;
  
+ static export_route_function orig_addroute_function;
+ static export_route_function orig_delroute_function;
  
  int olsrd_plugin_interface_version (void) {
***************
*** 81,95 ****
  			     set_plugin_parameter_addon addon __attribute__((unused))) {
    if (!strcmp(value, "only")) {
!     if (!olsr_addroute_remove_function(&olsr_ioctl_add_route, AF_INET))
!       puts ("AIII, could not remove the kernel route exporter");
!     if (!olsr_delroute_remove_function(&olsr_ioctl_del_route, AF_INET))
!       puts ("AIII, could not remove the kernel route deleter");
!     olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
!     olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
      zebra_export_routes(1);
    }
    else if (!strcmp(value, "additional")) {
!     olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET);
!     olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET);
      zebra_export_routes(1);
    }
--- 83,97 ----
  			     set_plugin_parameter_addon addon __attribute__((unused))) {
    if (!strcmp(value, "only")) {
!     orig_addroute_function = NULL;
!     orig_delroute_function = NULL;
!     olsr_addroute_function = zebra_add_olsr_v4_route;
!     olsr_delroute_function = zebra_del_olsr_v4_route;
      zebra_export_routes(1);
    }
    else if (!strcmp(value, "additional")) {
!     orig_addroute_function = olsr_addroute_function;
!     orig_delroute_function = olsr_delroute_function;
!     olsr_addroute_function = zebra_add_olsr_v4_route;
!     olsr_delroute_function = zebra_del_olsr_v4_route;
      zebra_export_routes(1);
    }





More information about the Olsr-cvs mailing list