A patch for Bro in OpenBSD

Hi,

I wrote a patch that enable Bro to compile on a OpenBSD system. This
patch is downloadable here :

http://www.detilly.net/ids/download/bro-0.8a32-OpenBSD.patch

See the README.OpenBSD which is given in the patch.

You should use the bind library too due to the libc resolv functions
which are not as complete as FreeBSD one. If you don't want to install
all bind9 sources, I just separate the interesting part here :

http://www.detilly.net/ids/download/bind.tgz

Regards,

I juste forget to say that I've got warning during compilation :

main.o: In function `main':
main.o(.text+0x17a9): warning: sprintf() is often misused, please use snprintf()

I don't solve it (don't search it)

I've got warning during execution too :

./bro: ./bro : WARNING: symbol(__p_class_syms) size mismatch relink your program
./bro: ./bro : WARNING: symbol(__p_type_syms) size mismatch relink your program

Like others warning, don't solve it.

I don't try to use Bro a lot with these warnings... But all must work
well.

Sylvain de Tilly <sylvain@detilly.net> a dit:

[...]

You should use the bind library too due to the libc resolv functions
which are not as complete as FreeBSD one. If you don't want to install
all bind9 sources, I just separate the interesting part here :

I found it easier just to install libbind from the ports collection; /usr/ports/net/libbind/

  -Chad

Hi Chad,

Thanks for your information, I didn't know the existence of this
library and it's sound like perfect for the problems. So I try to use
it but at the final linking stage of the compilation, I've got this
error message :

main.o: In function `main':
main.o(.text+0x17a9): warning: sprintf() is often misused, please use snprintf()
nb_dns.o: In function `nb_dns_init':
nb_dns.o(.text+0x80): undefined reference to `__res_state'
nb_dns.o(.text+0xf1): undefined reference to `__res_state'
collect2: ld returned 1 exit status

When I do an objdump -t to the libbind.so.1 or to libbind.a, I can't
see any __res_state symbols. If I do the same with the libbind found
in the official bind9, I find this symbol. My libbind is the 9.2.2rc2
from OpenBSD snapshot (less than 1 week).

So I'll keep the patch like that for the moment. If anybody have an
idea....

Regards,

Chad Dougherty <crd@cert.org> a dit:

Hrm. That's odd. What version of OpenBSD are you using? I'm using the 3.3-stable branch (both core OS and ports) and didn't have this problem. The libbind in the -stable ports branch is 9.2.2rc1.

  -Chad