[OLSR-users] olsr-0.5.0 with OpenBSD 4.0 compile problems

Patrick McCarty (spam-protected)
Fri Apr 27 18:30:14 CEST 2007


Hi all,

I'm experiencing some minor problems during compilation under a stock
OpenBSD 4.0 install. I've managed in the end to get a compiled version
which executes and seems to work, but I thought I'd report my findings
for others experiencing similar.

First error: Bison refuses to generate parse.c

gmake -C src/cfgparser
gmake[1]: Entering directory `/root/olsrtest/olsrd-0.5.0/src/cfgparser'
cc -Wall -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations -Wsign-compare -O2 -g -MD -Isrc -I../../src
-D__OpenBSD__ -DMAKELIB   -c -o olsrd_conf.o olsrd_conf.c
bison -d -ooparse.c oparse.y
gmake[1]: *** [oparse.c] Broken pipe
gmake[1]: Leaving directory `/root/olsrtest/olsrd-0.5.0/src/cfgparser'
gmake: *** [cfgparser] Error 2

In case anyone cares, Its bison (GNU Bison) 2.1

My action:

Copied cfgparser directory contents from an already compiled copy from
a Linux machine.
(This is probably a very bad idea, and it doesnt identify the cause of
the problem)

--------------------

Second error:
cc -DVERSION=\"0.5.0\" -MD -Isrc -I./src  -D__OpenBSD__   -c -o
src/bsd/net.o src/bsd/net.c
src/bsd/net.c: In function `set_sysctl_int':
src/bsd/net.c:141: warning: passing arg 4 of `sysctl' from
incompatible pointer type
src/bsd/net.c: In function `get_ipv6_address':
src/bsd/net.c:538: error: storage size of `ifr6' isn't known
src/bsd/net.c:549: error: dereferencing pointer to incomplete type
src/bsd/net.c:551: error: dereferencing pointer to incomplete type
src/bsd/net.c:552: error: dereferencing pointer to incomplete type
src/bsd/net.c:554: error: dereferencing pointer to incomplete type
src/bsd/net.c:564: error: `SIOCGIFAFLAG_IN6' undeclared (first use in
this function)
src/bsd/net.c:564: error: (Each undeclared identifier is reported only once
src/bsd/net.c:564: error: for each function it appears in.)
src/bsd/net.c:572: error: `IN6_IFF_ANYCAST' undeclared (first use in
this function)
src/bsd/net.c: In function `olsr_recvfrom':
src/bsd/net.c:728: error: storage size of `iov' isn't known
gmake: *** [src/bsd/net.o] Error 1

Seeing all sorts of compile errors in get_ipv6_address, and in my
particular case not caring about v6 support, I #if 0'd the whole
function replacing it with a stub:

int get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, int scope_in)
{
return 0;
}

Next, I was left with the iov size error... after a quick grep of
/usr/include, I found it referenced in sys/uio.h.

I added in the OpenBSD include section:
#include <sys/uio.h>

This left me with only several warnings:

src/bsd/net.c: In function `set_sysctl_int':
src/bsd/net.c:142: warning: passing arg 4 of `sysctl' from
incompatible pointer type

src/link_set.o(.text+0x6dc): In function `add_new_entry':
: warning: strcpy() is almost always misused, please use strlcpy()


At this point, I have a successfully compiled olsrd binary.

Executing yields this:
--- 22:19:37.51 ---------------------------------------------------- LINKS

IP address       hyst   LQ     lost   total  NLQ    ETX
192.168.0.103    0.000  1.000  0      100    1.000  1.00

--- 22:19:37.51 ------------------------------------------------ NEIGHBORS

IP address       LQ     NLQ    SYM   MPR   MPRS  will
192.168.0.103    1.000  1.000  YES   YES   NO    3

--- 22:19:37.02510068 ----------------------- TWO-HOP NEIGHBORS

IP addr (2-hop)  IP addr (1-hop)  TLQ
xx.xx.xx.xx     192.168.0.103    1.000

--- 22:19:37.51 ------------------------------------------------- TOPOLOGY

Source IP addr   Dest IP addr     LQ     ILQ    ETX
192.168.0.103    192.168.0.109    1.000  1.000  1.00
192.168.0.103    xx.xx.xx.xx     1.000  1.000  1.00
xx.xx.xx.xx     192.168.0.103    1.000  1.000  1.00
sendto(v4): Network is unreachable
sendto(v4): Network is unreachable

I am however experiencing regular messages as above, stating that its
trying to send packets to an unreachable network. I suspect this is
not serious, however intend to investigate soon.

Thanks,

Patrick




More information about the Olsr-users mailing list