[Olsr-dev] freebsd and tip

John Hay (spam-protected)
Wed Apr 1 20:30:59 CEST 2009


Hi,

Here is a patch to get olsr tip to compile on FreeBSD. It does not
work though. It just seems to exit with no error and I am still
battling to figure out where the messages go after the log changes:

#############
metro-tst1# ./olsrd --nofork -d 3 --log_stderr -f ../../olsrd.conf-new
no_fork set to 1
metro-tst1# ./olsrd --nofork -d 3 --log_stderr 
no_fork set to 1
metro-tst1# ./olsrd --nofork -d 3 
no_fork set to 1
metro-tst1# ./olsrd --nofork 
no_fork set to 1
Debug level: 0
No interfaces configured!
metro-tst1# ./olsrd --log_stderr -d 3  --nofork
metro-tst1# ./olsrd -d 3 --nofork
metro-tst1#
#############

John
-- 
John Hay -- (spam-protected) / (spam-protected)
-------------- next part --------------
--- src/bsd/kernel_routes.c.orig	2009-03-26 19:05:18.000000000 +0200
+++ src/bsd/kernel_routes.c	2009-03-31 21:12:00.000000000 +0200
@@ -45,6 +45,7 @@
 #include "process_routes.h"
 #include "net_olsr.h"
 #include "ipcalc.h"
+#include "olsr_logging.h"
 
 #include <errno.h>
 #include <unistd.h>
@@ -202,7 +203,9 @@
       memcpy(walker, sdl, sdl->sdl_len);
       walker += sdl_size;
       rtm->rtm_addrs |= RTA_GATEWAY;
+#ifdef RTF_CLONING
       rtm->rtm_flags |= RTF_CLONING;
+#endif
 #ifndef _WRS_KERNEL
       rtm->rtm_flags &= ~RTF_HOST;
 #endif
@@ -309,7 +312,7 @@
 #endif
     memcpy(walker, &sin6, sizeof(sin6));
     walker += sin_size;
-    rtm->rtm_addrs = RTA_GATEWAY;
+    rtm->rtm_addrs |= RTA_GATEWAY;
   }
   else {
     /*
@@ -327,7 +330,7 @@
 #endif
     memcpy(walker, &sin6, sizeof(sin6));
     walker += sin_size;
-    rtm->rtm_addrs = RTA_GATEWAY;
+    rtm->rtm_addrs |= RTA_GATEWAY;
     rtm->rtm_flags |= RTF_GATEWAY;
   }
 
--- src/bsd/net.c.orig	2009-03-26 19:05:18.000000000 +0200
+++ src/bsd/net.c	2009-03-31 21:14:15.000000000 +0200
@@ -39,13 +39,14 @@
  *
  */
 
-#include "../defs.h"
-#include "../net_os.h"
-#include "../ipcalc.h"
-#include "../parser.h"		/* dnc: needed for call to packet_parser() */
-#include "../olsr_protocol.h"
-#include "../common/string.h"
-#include "../misc.h"
+#include "defs.h"
+#include "net_os.h"
+#include "ipcalc.h"
+#include "parser.h"		/* dnc: needed for call to packet_parser() */
+#include "olsr_protocol.h"
+#include "common/string.h"
+#include "misc.h"
+#include "olsr_logging.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -541,7 +542,7 @@
   u_int32_t flags6;
 
   if (getifaddrs(&ifap) != 0) {
-    OLSR_WARN(LOG_NETWORKING, "getifaddrs() failed (%s).\n", strerro(errno));
+    OLSR_WARN(LOG_NETWORKING, "getifaddrs() failed (%s).\n", strerror(errno));
     return 0;
   }
 


More information about the Olsr-dev mailing list