[Olsr-cvs] olsrd-current/src/unix ifnet.c,1.40,1.41

Bernd Petrovitsch (spam-protected)
Wed Jan 31 13:36:52 CET 2007


Update of /cvsroot/olsrd/olsrd-current/src/unix
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15855/src/unix

Modified Files:
	ifnet.c 
Log Message:
* applied patches from the most recent FreiFunkFirmware (and fixed compile errors) according
  to http://www.olsr.org/pipermail/olsr-dev/2006-December/254036.html:
  - olsrd-libsmake.patch
  - olsrd-dyngwplain.patch
  - olsrd-txtinfo.patch
  - olsrd-quagga.patch
  - olsrd-quagga-routehandler.patch
  - olsrd-optimize.patch
  - olsrd-bmf-fixes.patch
  - olsrd-fixes-sven-ola.patch
  - olsrd-fixes-jhay-bsd.patch
  - olsrd-fixes-backport.patch
  - olsrd-fixes-routedel.patch
  - olsrd-cpu-overload.patch
  - olsrd-secure_key_path.patch
  - olsrd-hna_ip_fix.patch
  Not applied:
  - olsrd-nameservice+services.patch: This patch produced too many rejects to fix easily.
  - olsrd-fixes-eric.patch: This was not found on the webserver.
  - olsrd-bmf.patch: We had already a "bmf" plug-in in there.
* made the checksum type in the olsrd_secure plug-in "olsr_u8_t" (instead
   of a wild "char *" and "unsigned char *" mix) everywhere. It killed
   lots of warnings.
* localized the checksum_cache array in olsrd_secure.c.


Index: ifnet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** ifnet.c	15 Nov 2006 23:07:59 -0000	1.40
--- ifnet.c	31 Jan 2007 12:36:50 -0000	1.41
***************
*** 58,61 ****
--- 58,62 ----
  #include "lq_packet.h"
  #include "log.h"
+ #include "link_set.h"
  #include <signal.h>
  #include <sys/types.h>
***************
*** 411,414 ****
--- 412,417 ----
    olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
  
+   del_if_link_entries(&ifp->ip_addr);
+ 
    /*
     *Call possible ifchange functions registered by plugins  
***************
*** 713,716 ****
--- 716,730 ----
  }
  
+ static char basename[32];
+ char* if_basename(char* name);
+ char* if_basename(char* name)
+ {
+ 	char *p = strchr(name, ':');
+ 	if (0 == p || p - name >= (int)(sizeof(basename) / sizeof(basename[0]) - 1)) return name;
+ 	memcpy(basename, name, p - name);
+ 	basename[p - name] = 0;
+ 	return basename;
+ }
+ 
  /**
   * Initializes a interface described by iface,
***************
*** 857,864 ****
        
        /* Deactivate IP spoof filter */
!       deactivate_spoof(ifr.ifr_name, iface->index, olsr_cnf->ip_version);
        
        /* Disable ICMP redirects */
!       disable_redirects(ifr.ifr_name, iface->index, olsr_cnf->ip_version);
        
      }
--- 871,878 ----
        
        /* Deactivate IP spoof filter */
!       deactivate_spoof(if_basename(ifr.ifr_name), iface->index, olsr_cnf->ip_version);
        
        /* Disable ICMP redirects */
!       disable_redirects(if_basename(ifr.ifr_name), iface->index, olsr_cnf->ip_version);
        
      }
***************
*** 924,928 ****
    ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3");
        
!   strcpy(ifp->int_name, ifr.ifr_name);
    /* Segfaults if using strncpy(IFNAMSIZ) why oh why?? */
    ifp->int_next = ifnet;
--- 938,942 ----
    ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3");
        
!   strcpy(ifp->int_name, if_basename(ifr.ifr_name));
    /* Segfaults if using strncpy(IFNAMSIZ) why oh why?? */
    ifp->int_next = ifnet;





More information about the Olsr-cvs mailing list