See in-line!
-----Burton

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
> Of Jaco van Tonder
> Sent: Wednesday, March 17, 2004 3:32 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Ntop-dev] [FreeBSD 5.2.1-RC + CVS 3.0PRE2] Crash
>
>
> Burton M. Strauss III wrote:
>
> ><snip/>
> >
> >(First off, I wonder why the important value, ifaddr, isn't shown.  Might
> >try
> >
> ># print ifaddr
> >
> >
> I also noticed this, and I did try to print it, but gdb basically tells
> me that that variable does not exist? Weird.

D'oh... If the compiler optimized ifaddr as a register, there's no symbol
record in the executable for gdb to use.  To get around this we would have
to remove ALL of the -O2 commands in Makefile, so that there was no
optimization.  Gaakkk <sound of cat with hairball />

<snip />

> >I don't have a spare FreeBSD box, nor really want to build a
> custom kernel.
> >Try this little cheesey test program:
> >
<snip />
> This will not compile on my FreeBSD 5.2.1-RC machine with gcc 3.3.3.
> The messages I get is the following:
> mainframe# gcc -o inetntoptest inetntoptest.c
> inetntoptest.c:5: warning: `struct in6_addr' declared inside
> parameter list
> inetntoptest.c:5: warning: its scope is only this definition or
> declaration, which is probably not what you want
> inetntoptest.c: In function `main':
> inetntoptest.c:12: error: storage size of `a' isn't known

Smack. Different OSes, different packaging.  On 4.9, I've changed the test
program to:

       #include <sys/types.h>
       #include <sys/socket.h>
       #include <netinet/in.h>

char* _intop(struct in6_addr *addr, char *buf, u_short buflen) {
  return (char *)inet_ntop(AF_INET6, addr, buf, buflen);
}

int main(int argc, char *argv[]) {

  char* r;
  struct  in6_addr a;
  char d[INET6_ADDRSTRLEN];
  int i;

  memset(&d, 0, sizeof(d));
  for(i=0;i<16;i++)
    a.s6_addr[i]=15-i;

  printf("call to inet_ntop...");
  r = _intop(&a, d, sizeof(d));
  printf("returned %s\n", d);
}


Gives:

$ ./inetntoptest
call to inet_ntop...returned f0e:d0c:b0a:908:706:504:302:100

-----Burton


_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to