Date: Sun, 14 Oct 2001 00:44:57 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Matt Dillon <dillon@earth.backplane.com> Cc: Valentin Nechayev <netch@segfault.kiev.ua>, hackers@FreeBSD.ORG Subject: Re: sin_zero & bind problems Message-ID: <3BC94279.F9F166BE@mindspring.com> References: <20011013135842.A415@iv.nn.kiev.ua> <200110131717.f9DHHLR43887@earth.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Matt Dillon wrote: > Nobody in their right mind uses a struct sockaddr_in or any other > struct sock* type of structure without zeroing it first. I suppose > we can document that in the man pages, but we certainly should not go > hacking up the kernel code to work around bad programmers. It is common practice in Linux to ignore those portions in the connect/bind that aren't applicable. There is a huge amount of code written for Linux which just uses auto variables, jamming only the applicable data into the struct, before passing it. Arguably, FreeBSD should ignore the data not applicable to the bind, but this would mean pretending it was zero in the kernel. A number of other UNIX implementations also puke in this Linux-ism, so it's a good idea to require the zeroing. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BC94279.F9F166BE>