summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-04-27 20:01:29 +0000
committerwollman <wollman@FreeBSD.org>1997-04-27 20:01:29 +0000
commit6afbf203bd570424ecf3f9d9d9ced17f82c81adc (patch)
tree41103dcf8addc8e73880fc79975713ce1e6ba14c /sys/netinet/udp_usrreq.c
parentced78602fea5284de7f4cb1673405ad3f3ad57ce (diff)
downloadFreeBSD-src-6afbf203bd570424ecf3f9d9d9ced17f82c81adc.zip
FreeBSD-src-6afbf203bd570424ecf3f9d9d9ced17f82c81adc.tar.gz
The long-awaited mega-massive-network-code- cleanup. Part I.
This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index fe1a8fc..108bea5 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
- * $Id: udp_usrreq.c,v 1.36 1997/03/03 09:23:37 davidg Exp $
+ * $Id: udp_usrreq.c,v 1.37 1997/04/03 05:14:45 davidg Exp $
*/
#include <sys/param.h>
@@ -91,7 +91,7 @@ SYSCTL_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RD,
static struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
static int udp_output __P((struct inpcb *, struct mbuf *, struct mbuf *,
- struct mbuf *));
+ struct mbuf *, struct proc *));
static void udp_notify __P((struct inpcb *, int));
void
@@ -360,10 +360,11 @@ udp_ctlinput(cmd, sa, vip)
}
static int
-udp_output(inp, m, addr, control)
+udp_output(inp, m, addr, control, p)
register struct inpcb *inp;
register struct mbuf *m;
struct mbuf *addr, *control;
+ struct proc *p;
{
register struct udpiphdr *ui;
register int len = m->m_pkthdr.len;
@@ -388,7 +389,7 @@ udp_output(inp, m, addr, control)
* Must block input while temporarily connected.
*/
s = splnet();
- error = in_pcbconnect(inp, addr);
+ error = in_pcbconnect(inp, addr, p);
if (error) {
splx(s);
goto release;
@@ -480,7 +481,7 @@ udp_abort(struct socket *so)
}
static int
-udp_attach(struct socket *so, int proto)
+udp_attach(struct socket *so, int proto, struct proc *p)
{
struct inpcb *inp;
int s, error;
@@ -490,7 +491,7 @@ udp_attach(struct socket *so, int proto)
return EINVAL;
s = splnet();
- error = in_pcballoc(so, &udbinfo);
+ error = in_pcballoc(so, &udbinfo, p);
splx(s);
if (error)
return error;
@@ -502,7 +503,7 @@ udp_attach(struct socket *so, int proto)
}
static int
-udp_bind(struct socket *so, struct mbuf *nam)
+udp_bind(struct socket *so, struct mbuf *nam, struct proc *p)
{
struct inpcb *inp;
int s, error;
@@ -511,13 +512,13 @@ udp_bind(struct socket *so, struct mbuf *nam)
if (inp == 0)
return EINVAL;
s = splnet();
- error = in_pcbbind(inp, nam);
+ error = in_pcbbind(inp, nam, p);
splx(s);
return error;
}
static int
-udp_connect(struct socket *so, struct mbuf *nam)
+udp_connect(struct socket *so, struct mbuf *nam, struct proc *p)
{
struct inpcb *inp;
int s, error;
@@ -528,7 +529,7 @@ udp_connect(struct socket *so, struct mbuf *nam)
if (inp->inp_faddr.s_addr != INADDR_ANY)
return EISCONN;
s = splnet();
- error = in_pcbconnect(inp, nam);
+ error = in_pcbconnect(inp, nam, p);
splx(s);
if (error == 0)
soisconnected(so);
@@ -572,7 +573,7 @@ udp_disconnect(struct socket *so)
static int
udp_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
- struct mbuf *control)
+ struct mbuf *control, struct proc *p)
{
struct inpcb *inp;
@@ -581,7 +582,7 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr,
m_freem(m);
return EINVAL;
}
- return udp_output(inp, m, addr, control);
+ return udp_output(inp, m, addr, control, p);
}
static int
@@ -601,5 +602,5 @@ struct pr_usrreqs udp_usrreqs = {
pru_connect2_notsupp, in_control, udp_detach, udp_disconnect,
pru_listen_notsupp, in_setpeeraddr, pru_rcvd_notsupp,
pru_rcvoob_notsupp, udp_send, pru_sense_null, udp_shutdown,
- in_setsockaddr
+ in_setsockaddr, sosend, soreceive, soselect
};
OpenPOWER on IntegriCloud