[Olsr-dev] can't compile tip on os x

John Hay (spam-protected)
Tue Jun 3 12:00:55 CEST 2008

Hi Henning,

On Thu, May 29, 2008 at 07:22:12PM +0200, Henning Rogge wrote:
> The attached patch solves the problem in tc_set.c, but I get lot's of
> compiler errors in the BSD specific parts... and I have not enough
> experience (nearly none) with BSD to solve them.
> If someone else can test the patch (maybe the BSD specific problem is
> a toolchain problem) I will push it into the repository.

Your patch for tc_set.c looks ok. It is the same I came up with.

Here is my patch to make src/bsd/kernel_routes.c compile on FreeBSD.
I had a look through the previous change:


which is where stuff got broken and I think it is ok. I do not have an
ipv4 network to test it on though. The ipv6 part does seem to work
though. It connects to our network and the routes get updated. I have
not tested it much more than that.

About the patch, the BSDs that I know do not have ifaddrs.h in a sub
directory. We also do not have struct sockaddr_rt.

John Hay -- (spam-protected) / (spam-protected)

--- src/bsd/kernel_routes.c.orig	2008-05-24 12:28:31.000000000 +0200
+++ src/bsd/kernel_routes.c	2008-06-03 09:24:21.000000000 +0200
@@ -48,7 +48,7 @@
 #include "ipcalc.h"
 #include <net/if_dl.h>
-#include <net/ifaddrs.h>
+#include <ifaddrs.h>
 #ifdef _WRS_KERNEL
 #include <wrn/coreip/net/route.h>
@@ -126,11 +126,13 @@
   sin.sin_addr = rt->rt_dst.prefix.v4;
   OLSR_PRINTF(8, "\t- Destination of the route: %s\n", inet_ntoa(sin.sin_addr));
+#ifdef _WRS_KERNEL
   /* change proto or tos here */
   OLSR_PRINTF(8, "\t- Setting Protocol: 0\n");
   ((struct sockaddr_rt *)(&sin))->srt_proto = 0;
   OLSR_PRINTF(8, "\t- Setting TOS: 0\n");
   ((struct sockaddr_rt *)(&sin))->srt_tos = 0;
   memcpy(walker, &sin, sizeof(sin));
   walker += sin_size;

More information about the Olsr-dev mailing list