On Die, 2007-11-27 at 09:39 -0800, Patrick McCarty wrote:
> Bernd and others,
> 
> I did a quick compile check under OpenBSD 4.2.

Cool!

> Didn't compile. Below are two small patches that get it a bit further

Somewhat different applied.

> in compilation. The next error I didn't attempt to tackle is:

Yes, please!

> src/bsd/net.c: In function `calculate_if_metric':
> src/bsd/net.c:880: error: `WEIGHT_ETHERNET_DEFAULT' undeclared (first
> use in this function)
> src/bsd/net.c:880: error: (Each undeclared identifier is reported only once
> src/bsd/net.c:880: error: for each function it appears in.)
> gmake: *** [src/bsd/net.o] Error 1
[...]
> --- olsrd-current/src/bsd/kernel_routes.c       Tue Nov 27 05:39:22 2007
> +++ olsrd-current.pwm/src/bsd/kernel_routes.c   Tue Nov 27 01:32:10 2007
> @@ -111,7 +111,7 @@
>    nexthop = olsr_get_nh(rt);
>    if ((flags & RTF_GATEWAY) != 0)
>    {
> -    sin.sin_addr.s_addr = nexthop->gateway.v4;
> +    sin.sin_addr.s_addr = nexthop->gateway.v4.s_addr;

I prefer to fix these errors as
----  snip  ----
+    sin.sin_addr = nexthop->gateway.v4;
----  snip  ----
to conceptually "copy the whole IP address" (IPv4 in this case). It
works syntactically the same in IPV6 and it should generate the same
code as your (also correct!) solution as the struct has just one 32bit
int.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




