aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver/nfs_srvcache.c
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
commit57bf258e3dc9e77a996e738e6bf3e894943970e2 (patch)
tree6c0a9710fd977c7f3055d78384c325bb09195b9e /sys/nfsserver/nfs_srvcache.c
parentcee405ba2712660bd47480f9c304163545121639 (diff)
downloadsrc-57bf258e3dc9e77a996e738e6bf3e894943970e2.tar.gz
src-57bf258e3dc9e77a996e738e6bf3e894943970e2.zip
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.
Notes
Notes: svn path=/head/; revision=28270
Diffstat (limited to 'sys/nfsserver/nfs_srvcache.c')
-rw-r--r--sys/nfsserver/nfs_srvcache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c
index c2623a30a471..6c6be6d08d83 100644
--- a/sys/nfsserver/nfs_srvcache.c
+++ b/sys/nfsserver/nfs_srvcache.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_srvcache.c 8.3 (Berkeley) 3/30/95
- * $Id: nfs_srvcache.c,v 1.12 1997/05/10 16:12:03 dfr Exp $
+ * $Id: nfs_srvcache.c,v 1.13 1997/08/02 14:33:07 bde Exp $
*/
#ifndef NFS_NOSERVER
@@ -49,6 +49,7 @@
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/socket.h>
+#include <sys/socketvar.h> /* for dup_sockaddr */
#include <netinet/in.h>
#ifdef ISO
@@ -239,13 +240,13 @@ loop:
if (rp->rc_flag & RC_REPMBUF)
m_freem(rp->rc_reply);
if (rp->rc_flag & RC_NAM)
- MFREE(rp->rc_nam, mb);
+ FREE(rp->rc_nam, M_SONAME);
rp->rc_flag &= (RC_LOCKED | RC_WANTED);
}
TAILQ_INSERT_TAIL(&nfsrvlruhead, rp, rc_lru);
rp->rc_state = RC_INPROG;
rp->rc_xid = nd->nd_retxid;
- saddr = mtod(nd->nd_nam, struct sockaddr_in *);
+ saddr = (struct sockaddr_in *)nd->nd_nam;
switch (saddr->sin_family) {
case AF_INET:
rp->rc_flag |= RC_INETADDR;
@@ -254,7 +255,7 @@ loop:
case AF_ISO:
default:
rp->rc_flag |= RC_NAM;
- rp->rc_nam = m_copym(nd->nd_nam, 0, M_COPYALL, M_WAIT);
+ rp->rc_nam = dup_sockaddr(nd->nd_nam, 1);
break;
};
rp->rc_proc = nd->nd_procnum;