Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Jul 2014 07:28:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-standards@FreeBSD.org
Subject:   [Bug 191586] FreeBSD doesn't validate negative edgecases in bind(2)/connect(2)/listen(2) like POSIX requires
Message-ID:  <bug-191586-15-24vRDCGYXR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-191586-15@https.bugs.freebsd.org/bugzilla/>
References:  <bug-191586-15@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586

--- Comment #7 from Kevin Lo <kevlo@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-191586-15-24vRDCGYXR>