[Bug 191586] FreeBSD doesn't validate negative edgecases in bind(2)/connect(2)/listen(2) like POSIX requires
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Jul 7 07:28:02 UTC 2014
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586
--- Comment #7 from Kevin Lo <kevlo at FreeBSD.org> ---
Nah, it doesn't make sense to me either.
According to TCP/IP Illustrated, Vol 2, section 22.7, figure 22.22:
72 if (nam) {
73 sin = mtod(nam, struct sockaddr_in *);
74 if (nam->m_len != sizeof(*sin))
75 return (EINVAL);
76 #ifdef notdef
77 /*
78 * We should check the family, but old programs
79 * incorrectly fail to initialize it.
80 */
81 if (sin->sin_family != AF_INET)
82 return (EAFNOSUPPORT);
83 #endif
84 lport = sin->sin_port; /* might be 0 */
76 - 83
The test for the correct address family is commented out, yet the identical
test in the in_pcbconnect function is performed. We expect either both
to be in or both to be out.
Do you think both functions shouldn't perform the check? Thanks.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-standards
mailing list