summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_reass.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
committerwollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
commit4542c1cf5d7077caf33d6d9468f5e647cd9d19e5 (patch)
tree69fd093ef1e8c080592999507b664fe6315c0e10 /sys/netinet/tcp_reass.c
parentf4edc7fc6748272644fb845fc8636a5c261247d6 (diff)
downloadFreeBSD-src-4542c1cf5d7077caf33d6d9468f5e647cd9d19e5.zip
FreeBSD-src-4542c1cf5d7077caf33d6d9468f5e647cd9d19e5.tar.gz
Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r--sys/netinet/tcp_reass.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 33e9b60..14f0754 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
- * $Id: tcp_input.c,v 1.58 1997/04/27 20:01:13 wollman Exp $
+ * $Id: tcp_input.c,v 1.59 1997/07/01 05:42:16 jdp Exp $
*/
#ifndef TUBA_INCLUDE
@@ -640,11 +640,10 @@ findpcb:
if (m->m_flags & (M_BCAST|M_MCAST) ||
IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
goto drop;
- am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
- if (am == NULL)
+ MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME,
+ M_NOWAIT);
+ if (sin == NULL)
goto drop;
- am->m_len = sizeof (struct sockaddr_in);
- sin = mtod(am, struct sockaddr_in *);
sin->sin_family = AF_INET;
sin->sin_len = sizeof(*sin);
sin->sin_addr = ti->ti_src;
@@ -653,12 +652,12 @@ findpcb:
laddr = inp->inp_laddr;
if (inp->inp_laddr.s_addr == INADDR_ANY)
inp->inp_laddr = ti->ti_dst;
- if (in_pcbconnect(inp, am, &proc0)) { /* XXX creds */
+ if (in_pcbconnect(inp, (struct sockaddr *)sin, &proc0)) {
inp->inp_laddr = laddr;
- (void) m_free(am);
+ FREE(sin, M_SONAME);
goto drop;
}
- (void) m_free(am);
+ FREE(sin, M_SONAME);
tp->t_template = tcp_template(tp);
if (tp->t_template == 0) {
tp = tcp_drop(tp, ENOBUFS);
OpenPOWER on IntegriCloud