> I was looking at the Linux sockets code, and noticed that address family > (sockaddr_in.sin_family) doesn't get checked on a bind() to a datagram > socket. Only the address length is verified. (I'm looking at inet_bind(), > in net/ipv4/af_inet.c) Why bother checking that field? The address family is redundant information; when you created the socket, you already specified the family. If you consider it an error, stick an assert() into your program. Returning EINVAL would only risk breaking programs that don't set the address family field; it would not provide any added functionality to programs that do set the field. - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [EMAIL PROTECTED]
Re: sin_family not checked for UDP sockets?
Kaz Kylheku <[EMAIL PROTECTED]> Tue, 9 Mar 1999 02:19:13 -0500
- sin_family not checked for UDP socke... Mark Gritter
- Re: sin_family not checked for ... Kaz Kylheku <[EMAIL PROTECTED]>
- Re: sin_family not checked ... Olaf Titz
