fun with sockaddr...
bhards at bigpond.net.au
Sat Sep 14 14:50:02 EST 2002
-----BEGIN PGP SIGNED MESSAGE-----
I'm a bit confused about the protocol indpendent socket stuff under Linux.
I'm trying to port some code from BSD (a multicast DNS responder, from the
KAME project) to Linux, but it isn't going too well. I got some of it
(ifaddrs.h+ifaddrs.c) from the USAGI project, but I think I have some
fundamental missing stuff.
h1 = h2 = '\0';
if (getnameinfo((struct sockaddr *)&ss,
((struct sockaddr *)&ss)->sa_len, h1, sizeof(h1),
p, sizeof(p), niflag) != 0)
As far as I can tell, sockaddr doesn't have a sa_len element (and the compiler
agrees). The man page for getnameinfo() doesn't help me much - it also uses
the sa_len approach.
Can anyone provide any hints on how to fix this. Or better yet, any tutorial
material on doing ports of BSD code to Linux (I have
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----
More information about the linux