Subject: Re: garbage at sockaddr_in.sin_zero
To: None <jchacon@genuity.net>
From: Shin'ichiro TAYA <taya@sm.sony.co.jp>
List: current-users
Date: 10/22/2000 14:36:46
From: jchacon@genuity.net
Subject: Re: garbage at sockaddr_in.sin_zero
Date: Sun, 22 Oct 2000 01:11:19 -0400 (EDT)

> Your "in" var is an automatic variable. You can't depend on it being
> zero'd out. So, garbage in, garbage out as far as the bind call goes.
> 
> bzero it first before setting values.

I know why it fails and should clear whole structure before set each member.
My question is:

I set sin_family to AF_INET, so only sin_port & sin_addr should be meaningfull.
But library or kernel is refering sin_zero.
Is it a right behavor and is it documented in somewhere?

I'm playing with PSM(Personal Security Manager) for mozilla.
With PSM you can use SSL with mozilla.
There is a bug like my sample code.
I'm going to submit a fix for this(bzero(&in, sizeof(in))). But before
submit, I want to clarify it's a bug of PSM code or bug of NetBSD.