sanity check in bro

Jean-Marc Nimal jni at
Thu Dec 17 09:08:22 PST 1998

> Hi,
> I'm sure I'm missing something easy here, but I need a set of
> more experienced eyes to help me with this.

I do not consider my eyes as so much experienced, but it seems to me
to be a simple C/C++ problem. 

> In, NetSessions::NextPacket(), there is:
> 	uint32 src_addr = uint32(ip->ip_src.s_addr);
>         uint32 dst_addr = uint32(ip->ip_dst.s_addr);
>         uint32 src_port, dst_port;
> // grue - print src/dst asap
>         fprintf(stderr, "src %s  dst %s\n", dotted_addr(src_addr),
>                 dotted_addr(dst_addr));

Here is it: dotted_aadr returns a pointer to the same static buffer.
So you get the result of the second call. However, the function
dotted_addr seems to include two static buffers (someone must have
had the same problem ;-) so you probably can try:

        fprintf(stderr, "src %s  dst %s\n", dotted_addr(src_addr,0),

Where 0/1 selects the buffer (see

Hopefully it helps; I'm not a C++ guru anyway, so maybe I'm completely
wrong and off-topic :-)

Jean-Marc Nimal
Aethis sa/nv
mailto:Jean-Marc.Nimal at

Hoping this goes to the list as this is my first attempt to post to it.

More information about the Bro mailing list