Subject: Re: Socket Application
To: Joe Magee <netbsd-help@netbsd.org>
From: Giorgos Keramidas <keramida@FreeBSD.org>
List: netbsd-help
Date: 09/27/2002 19:57:39
Joe Magee <jmagee@starrider.com> wrote:
: This includes the statement I made about the code working on linux. =
While it
: did "work" the fact was that both the client and server were using =
bogus
: port numbers--just happened both used the same bogus port number.

Hehehe :)

Indeed.  What you describe is true.  I can't remember where,
but I have this vague recollection of the fact that the BSDs
actually "depend" on 'struct sockaddr_in' being bzero()'d.

I'll have to dig a bit in my mail archives for hints, but for
the time being, you'll be safe by always doing:

    struct sockaddr_in *sinaddr;

    bzero((char *)&sinaddr, sizeof(sinaddr));
    /* Set fields. */
    /* Use sinaddr. */

Giorgos.