[Olsr-cvs] olsrd-current/src/unix ifnet.c,1.34,1.35

Andreas T�nnesen (spam-protected)
Tue Jan 10 21:38:21 CET 2006


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

Modified Files:
	ifnet.c 
Log Message:
Wow, there are some serious issue with libnet using UDP+IPv6... To bad since this is what we really wanted libnet for. I'll see if I can create a workaround, as for now there is no UDP checksum in the IPv6 packets beeing sent...

Index: ifnet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** ifnet.c	8 Jan 2006 20:27:18 -0000	1.34
--- ifnet.c	10 Jan 2006 20:38:19 -0000	1.35
***************
*** 896,900 ****
    
    ifp = olsr_malloc(sizeof (struct interface), "Interface update 2");
!   
    iface->configured = 1;
    iface->interf = ifp;
--- 896,900 ----
    
    ifp = olsr_malloc(sizeof (struct interface), "Interface update 2");
! 
    iface->configured = 1;
    iface->interf = ifp;
***************
*** 902,905 ****
--- 902,906 ----
    memcpy(ifp, &ifs, sizeof(struct interface));
    
+   ifp->libnet_ctx = NULL;  
    ifp->gen_properties = NULL;
    ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3");
***************
*** 958,976 ****
  
  #ifdef USE_LIBNET
!       ifp->libnet_ctx = libnet_init((olsr_cnf->ip_version == AF_INET) ? 
! 				    LIBNET_RAW4 : LIBNET_RAW6, 
! 				    ifp->int_name, get_libnet_errbuf());
! 
!       if(ifp->libnet_ctx == NULL)
! 	{
! 	  fprintf(stderr, "Could not initialize libnet... exiting!\n\n");
! 	  olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n");
! 	  olsr_cnf->exit_value = EXIT_FAILURE;
! 	  kill(getpid(), SIGINT);
! 	}
  #else
!       ifp->libnet_ctx = NULL;
  #endif
!   
    /* Register socket */
    add_olsr_socket(ifp->olsr_socket, &olsr_input);
--- 959,980 ----
  
  #ifdef USE_LIBNET
! #if 1
!   ifp->libnet_ctx = libnet_init((olsr_cnf->ip_version == AF_INET) ? 
! 				LIBNET_RAW4 : LIBNET_RAW6, 
! 				ifp->int_name, get_libnet_errbuf());
  #else
!   ifp->libnet_ctx = libnet_init(LIBNET_LINK, ifp->int_name, get_libnet_errbuf());
  #endif
! 
!   if(ifp->libnet_ctx == NULL)
!     {
!       fprintf(stderr, "Could not initialize libnet... exiting!\n\n");
!       olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n");
!       olsr_cnf->exit_value = EXIT_FAILURE;
!       kill(getpid(), SIGINT);
!     }
! #endif
!   set_buffer_timer(ifp);
! 
    /* Register socket */
    add_olsr_socket(ifp->olsr_socket, &olsr_input);





More information about the Olsr-cvs mailing list