summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1998-08-23 03:07:17 +0000
committerwollman <wollman@FreeBSD.org>1998-08-23 03:07:17 +0000
commita76fb5eefabdc9418c911bf0b61768d533c15cbd (patch)
tree02b1e59b8833c25c113cc2a72ebb74ec057423bb /sys/nfsserver
parent3846bf0ec8c81eca47577791dff72e8b96928749 (diff)
downloadFreeBSD-src-a76fb5eefabdc9418c911bf0b61768d533c15cbd.zip
FreeBSD-src-a76fb5eefabdc9418c911bf0b61768d533c15cbd.tar.gz
Yow! Completely change the way socket options are handled, eliminating
another specialized mbuf type in the process. Also clean up some of the cruft surrounding IPFW, multicast routing, RSVP, and other ill-explored corners.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs.h4
-rw-r--r--sys/nfsserver/nfs_srvsock.c32
-rw-r--r--sys/nfsserver/nfs_syscalls.c30
-rw-r--r--sys/nfsserver/nfsrvstats.h4
4 files changed, 47 insertions, 23 deletions
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h
index e5be581..885a2c1 100644
--- a/sys/nfsserver/nfs.h
+++ b/sys/nfsserver/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.41 1998/06/30 03:01:37 jmg Exp $
+ * $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
*/
#ifndef _NFS_NFS_H_
@@ -722,7 +722,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
struct proc *procp, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
+void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag));
void nfsrv_slpderef __P((struct nfssvc_sock *slp));
#endif /* KERNEL */
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index d4e1a04..693899f 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_socket.c,v 1.42 1998/07/15 02:32:24 bde Exp $
+ * $Id: nfs_socket.c,v 1.43 1998/08/01 09:04:02 peter Exp $
*/
/*
@@ -282,16 +282,28 @@ nfs_connect(nmp, rep)
if (nmp->nm_sotype != SOCK_STREAM)
panic("nfscon sotype");
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
- MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int32_t *) = 1;
- m->m_len = sizeof(int32_t);
- sosetopt(so, SOL_SOCKET, SO_KEEPALIVE, m, p);
+ struct sockopt sopt;
+ int val;
+
+ bzero(&sopt, sizeof sopt);
+ sopt.sopt_level = SOL_SOCKET;
+ sopt.sopt_name = SO_KEEPALIVE;
+ sopt.sopt_val = &val;
+ sopt.sopt_valsize = sizeof val;
+ val = 1;
+ sosetopt(so, &sopt);
}
if (so->so_proto->pr_protocol == IPPROTO_TCP) {
- MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int32_t *) = 1;
- m->m_len = sizeof(int32_t);
- sosetopt(so, IPPROTO_TCP, TCP_NODELAY, m, p);
+ struct sockopt sopt;
+ int val;
+
+ bzero(&sopt, sizeof sopt);
+ sopt.sopt_level = IPPROTO_TCP;
+ sopt.sopt_name = TCP_NODELAY;
+ sopt.sopt_val = &val;
+ sopt.sopt_valsize = sizeof val;
+ val = 1;
+ sosetopt(so, &sopt);
}
sndreserve = (nmp->nm_wsize + NFS_MAXPKTHDR +
sizeof (u_int32_t)) * 2;
@@ -1952,7 +1964,7 @@ nfs_msg(p, server, msg)
void
nfsrv_rcv(so, arg, waitflag)
struct socket *so;
- caddr_t arg;
+ void *arg;
int waitflag;
{
register struct nfssvc_sock *slp = (struct nfssvc_sock *)arg;
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index 08a1f13..c6b92d5 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_syscalls.c,v 1.40 1998/05/31 18:46:06 peter Exp $
+ * $Id: nfs_syscalls.c,v 1.41 1998/05/31 20:08:55 peter Exp $
*/
#include <sys/param.h>
@@ -400,17 +400,29 @@ nfssvc_addsock(fp, mynam, p)
* repeatedly for the same socket, but that isn't harmful.
*/
if (so->so_type == SOCK_STREAM) {
- MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int32_t *) = 1;
- m->m_len = sizeof(int32_t);
- sosetopt(so, SOL_SOCKET, SO_KEEPALIVE, m, p);
+ struct sockopt sopt;
+ int val;
+
+ bzero(&sopt, sizeof sopt);
+ sopt.sopt_level = SOL_SOCKET;
+ sopt.sopt_name = SO_KEEPALIVE;
+ sopt.sopt_val = &val;
+ sopt.sopt_valsize = sizeof val;
+ val = 1;
+ sosetopt(so, &sopt);
}
if (so->so_proto->pr_domain->dom_family == AF_INET &&
so->so_proto->pr_protocol == IPPROTO_TCP) {
- MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int32_t *) = 1;
- m->m_len = sizeof(int32_t);
- sosetopt(so, IPPROTO_TCP, TCP_NODELAY, m, p);
+ struct sockopt sopt;
+ int val;
+
+ bzero(&sopt, sizeof sopt);
+ sopt.sopt_level = IPPROTO_TCP;
+ sopt.sopt_name = TCP_NODELAY;
+ sopt.sopt_val = &val;
+ sopt.sopt_valsize = sizeof val;
+ val = 1;
+ sosetopt(so, &sopt);
}
so->so_rcv.sb_flags &= ~SB_NOINTR;
so->so_rcv.sb_timeo = 0;
diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h
index e5be581..885a2c1 100644
--- a/sys/nfsserver/nfsrvstats.h
+++ b/sys/nfsserver/nfsrvstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.41 1998/06/30 03:01:37 jmg Exp $
+ * $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
*/
#ifndef _NFS_NFS_H_
@@ -722,7 +722,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
struct proc *procp, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag));
+void nfsrv_rcv __P((struct socket *so, void *arg, int waitflag));
void nfsrv_slpderef __P((struct nfssvc_sock *slp));
#endif /* KERNEL */
OpenPOWER on IntegriCloud