diff options
author | wollman <wollman@FreeBSD.org> | 1997-08-16 19:16:27 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-08-16 19:16:27 +0000 |
commit | 4542c1cf5d7077caf33d6d9468f5e647cd9d19e5 (patch) | |
tree | 69fd093ef1e8c080592999507b664fe6315c0e10 /sys/netinet | |
parent | f4edc7fc6748272644fb845fc8636a5c261247d6 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/netinet/in_pcb.c | 41 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 13 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 18 | ||||
-rw-r--r-- | sys/netinet/tcp_fsm.h | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 15 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 15 | ||||
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 31 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 15 | ||||
-rw-r--r-- | sys/netinet/udp_var.h | 13 |
9 files changed, 87 insertions, 78 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 95409fc..77ff62d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95 - * $Id: in_pcb.c,v 1.32 1997/05/19 00:18:30 tegge Exp $ + * $Id: in_pcb.c,v 1.33 1997/05/19 01:28:39 tegge Exp $ */ #include <sys/param.h> @@ -138,7 +138,7 @@ in_pcballoc(so, pcbinfo, p) int in_pcbbind(inp, nam, p) register struct inpcb *inp; - struct mbuf *nam; + struct sockaddr *nam; struct proc *p; { register struct socket *so = inp->inp_socket; @@ -157,8 +157,8 @@ in_pcbbind(inp, nam, p) (so->so_options & SO_ACCEPTCONN) == 0)) wild = 1; if (nam) { - sin = mtod(nam, struct sockaddr_in *); - if (nam->m_len != sizeof (*sin)) + sin = (struct sockaddr_in *)nam; + if (nam->sa_len != sizeof (*sin)) return (EINVAL); #ifdef notdef /* @@ -188,7 +188,7 @@ in_pcbbind(inp, nam, p) struct inpcb *t; /* GROSS */ - if (ntohs(lport) < IPPORT_RESERVED && + if (ntohs(lport) < IPPORT_RESERVED && p && (error = suser(p->p_ucred, &p->p_acflag))) return (EACCES); t = in_pcblookup(inp->inp_pcbinfo, zeroin_addr, 0, @@ -209,7 +209,7 @@ in_pcbbind(inp, nam, p) last = ipport_hilastauto; lastport = &inp->inp_pcbinfo->lasthi; } else if (inp->inp_flags & INP_LOWPORT) { - if (error = suser(p->p_ucred, &p->p_acflag)) + if (p && (error = suser(p->p_ucred, &p->p_acflag))) return error; first = ipport_lowfirstauto; /* 1023 */ last = ipport_lowlastauto; /* 600 */ @@ -278,13 +278,13 @@ in_pcbbind(inp, nam, p) int in_pcbladdr(inp, nam, plocal_sin) register struct inpcb *inp; - struct mbuf *nam; + struct sockaddr *nam; struct sockaddr_in **plocal_sin; { struct in_ifaddr *ia; - register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); + register struct sockaddr_in *sin = (struct sockaddr_in *)nam; - if (nam->m_len != sizeof (*sin)) + if (nam->sa_len != sizeof (*sin)) return (EINVAL); if (sin->sin_family != AF_INET) return (EAFNOSUPPORT); @@ -395,11 +395,11 @@ in_pcbladdr(inp, nam, plocal_sin) int in_pcbconnect(inp, nam, p) register struct inpcb *inp; - struct mbuf *nam; + struct sockaddr *nam; struct proc *p; { struct sockaddr_in *ifaddr; - register struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); + register struct sockaddr_in *sin = (struct sockaddr_in *)nam; int error; /* @@ -414,7 +414,7 @@ in_pcbconnect(inp, nam, p) return (EADDRINUSE); if (inp->inp_laddr.s_addr == INADDR_ANY) { if (inp->inp_lport == 0) - (void)in_pcbbind(inp, (struct mbuf *)0, p); + (void)in_pcbbind(inp, (struct sockaddr *)0, p); inp->inp_laddr = ifaddr->sin_addr; } inp->inp_faddr = sin->sin_addr; @@ -463,12 +463,13 @@ in_pcbdetach(inp) * without the need for a wrapper function. The socket must have a valid * (i.e., non-nil) PCB, but it should be impossible to get an invalid one * except through a kernel programming error, so it is acceptable to panic - * (or in this case trap) if the PCB is invalid. + * (or in this case trap) if the PCB is invalid. (Actually, we don't trap + * because there actually /is/ a programming error somewhere... XXX) */ int in_setsockaddr(so, nam) struct socket *so; - struct mbuf *nam; + struct sockaddr **nam; { int s; register struct inpcb *inp; @@ -480,9 +481,9 @@ in_setsockaddr(so, nam) splx(s); return EINVAL; } - nam->m_len = sizeof (*sin); - sin = mtod(nam, struct sockaddr_in *); - bzero((caddr_t)sin, sizeof (*sin)); + MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME, M_WAITOK); + *nam = (struct sockaddr *)sin; + bzero(sin, sizeof *sin); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_port = inp->inp_lport; @@ -494,7 +495,7 @@ in_setsockaddr(so, nam) int in_setpeeraddr(so, nam) struct socket *so; - struct mbuf *nam; + struct sockaddr **nam; { int s; struct inpcb *inp; @@ -506,8 +507,8 @@ in_setpeeraddr(so, nam) splx(s); return EINVAL; } - nam->m_len = sizeof (*sin); - sin = mtod(nam, struct sockaddr_in *); + MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME, M_WAITOK); + *nam = (struct sockaddr *)sin; bzero((caddr_t)sin, sizeof (*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 6d6cdc6..18e40e9 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 - * $Id: in_pcb.h,v 1.20 1997/04/03 05:14:41 davidg Exp $ + * $Id: in_pcb.h,v 1.21 1997/04/27 20:01:04 wollman Exp $ */ #ifndef _NETINET_IN_PCB_H_ @@ -92,6 +92,7 @@ struct inpcbinfo { #define INP_LOWPORT 0x20 /* user wants "low" port binding */ #define INP_ANONPORT 0x40 /* port chosen for user */ #define INP_RECVIF 0x80 /* receive incoming interface */ +#define INP_MTUDISC 0x100 /* user can do MTU discovery */ #define INP_CONTROLOPTS (INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\ INP_RECVIF) @@ -102,11 +103,11 @@ struct inpcbinfo { #ifdef KERNEL void in_losing __P((struct inpcb *)); int in_pcballoc __P((struct socket *, struct inpcbinfo *, struct proc *)); -int in_pcbbind __P((struct inpcb *, struct mbuf *, struct proc *)); -int in_pcbconnect __P((struct inpcb *, struct mbuf *, struct proc *)); +int in_pcbbind __P((struct inpcb *, struct sockaddr *, struct proc *)); +int in_pcbconnect __P((struct inpcb *, struct sockaddr *, struct proc *)); void in_pcbdetach __P((struct inpcb *)); void in_pcbdisconnect __P((struct inpcb *)); -int in_pcbladdr __P((struct inpcb *, struct mbuf *, +int in_pcbladdr __P((struct inpcb *, struct sockaddr *, struct sockaddr_in **)); struct inpcb * in_pcblookup __P((struct inpcbinfo *, @@ -117,8 +118,8 @@ struct inpcb * void in_pcbnotify __P((struct inpcbhead *, struct sockaddr *, u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int))); void in_pcbrehash __P((struct inpcb *)); -int in_setpeeraddr __P((struct socket *so, struct mbuf *nam)); -int in_setsockaddr __P((struct socket *so, struct mbuf *nam)); +int in_setpeeraddr __P((struct socket *so, struct sockaddr **nam)); +int in_setsockaddr __P((struct socket *so, struct sockaddr **nam)); #endif #endif diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index b5b3c7d..0afd764 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ip.c,v 1.46 1997/05/22 20:52:56 fenner Exp $ + * $Id: raw_ip.c,v 1.47 1997/08/02 14:32:54 bde Exp $ */ #include <sys/param.h> @@ -440,12 +440,12 @@ rip_disconnect(struct socket *so) } static int -rip_bind(struct socket *so, struct mbuf *nam, struct proc *p) +rip_bind(struct socket *so, struct sockaddr *nam, struct proc *p) { struct inpcb *inp = sotoinpcb(so); - struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); + struct sockaddr_in *addr = (struct sockaddr_in *)nam; - if (nam->m_len != sizeof(*addr)) + if (nam->sa_len != sizeof(*addr)) return EINVAL; if (TAILQ_EMPTY(&ifnet) || ((addr->sin_family != AF_INET) && @@ -458,12 +458,12 @@ rip_bind(struct socket *so, struct mbuf *nam, struct proc *p) } static int -rip_connect(struct socket *so, struct mbuf *nam, struct proc *p) +rip_connect(struct socket *so, struct sockaddr *nam, struct proc *p) { struct inpcb *inp = sotoinpcb(so); - struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); + struct sockaddr_in *addr = (struct sockaddr_in *)nam; - if (nam->m_len != sizeof(*addr)) + if (nam->sa_len != sizeof(*addr)) return EINVAL; if (TAILQ_EMPTY(&ifnet)) return EADDRNOTAVAIL; @@ -483,7 +483,7 @@ rip_shutdown(struct socket *so) } static int -rip_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam, +rip_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct proc *p) { struct inpcb *inp = sotoinpcb(so); @@ -500,7 +500,7 @@ rip_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam, m_freem(m); return ENOTCONN; } - dst = mtod(nam, struct sockaddr_in *)->sin_addr.s_addr; + dst = ((struct sockaddr_in *)nam)->sin_addr.s_addr; } return rip_output(m, so, dst); } diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index 3f2c12f..804a55e 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tcp_fsm.h,v 1.9 1997/02/22 09:41:39 peter Exp $ */ #ifndef _NETINET_TCP_FSM_H_ @@ -73,7 +73,7 @@ static u_char tcp_outflags[TCP_NSTATES] = { TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, TH_ACK, TH_ACK, - TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, + TH_FIN|TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, }; #endif diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 33e9b60..14f0754 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.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); 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); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 36256fd..ab2f3b6 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $Id: tcp_usrreq.c,v 1.31 1997/04/27 20:01:14 wollman Exp $ + * $Id: tcp_usrreq.c,v 1.32 1997/08/02 14:32:58 bde Exp $ */ #include <sys/param.h> @@ -67,7 +67,7 @@ extern char *tcpstates[]; /* XXX ??? */ static int tcp_attach __P((struct socket *, struct proc *)); -static int tcp_connect __P((struct tcpcb *, struct mbuf *, +static int tcp_connect __P((struct tcpcb *, struct sockaddr *, struct proc *)); static struct tcpcb * tcp_disconnect __P((struct tcpcb *)); @@ -139,10 +139,7 @@ tcp_usr_detach(struct socket *so) } tp = intotcpcb(inp); TCPDEBUG1(); - if (tp->t_state > TCPS_LISTEN) - tp = tcp_disconnect(tp); - else - tp = tcp_close(tp); + tp = tcp_disconnect(tp); TCPDEBUG2(PRU_DETACH); splx(s); @@ -166,7 +163,7 @@ tcp_usr_detach(struct socket *so) * Give the socket an address. */ static int -tcp_usr_bind(struct socket *so, struct mbuf *nam, struct proc *p) +tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct proc *p) { int s = splnet(); int error = 0; @@ -180,7 +177,7 @@ tcp_usr_bind(struct socket *so, struct mbuf *nam, struct proc *p) * Must check for multicast addresses and disallow binding * to them. */ - sinp = mtod(nam, struct sockaddr_in *); + sinp = (struct sockaddr_in *)nam; if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) { error = EAFNOSUPPORT; @@ -206,7 +203,7 @@ tcp_usr_listen(struct socket *so, struct proc *p) COMMON_START(); if (inp->inp_lport == 0) - error = in_pcbbind(inp, (struct mbuf *)0, p); + error = in_pcbbind(inp, (struct sockaddr *)0, p); if (error == 0) tp->t_state = TCPS_LISTEN; COMMON_END(PRU_LISTEN); @@ -220,7 +217,7 @@ tcp_usr_listen(struct socket *so, struct proc *p) * Send initial segment on connection. */ static int -tcp_usr_connect(struct socket *so, struct mbuf *nam, struct proc *p) +tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct proc *p) { int s = splnet(); int error = 0; @@ -233,7 +230,7 @@ tcp_usr_connect(struct socket *so, struct mbuf *nam, struct proc *p) /* * Must disallow TCP ``connections'' to multicast addresses. */ - sinp = mtod(nam, struct sockaddr_in *); + sinp = (struct sockaddr_in *)nam; if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) { error = EAFNOSUPPORT; @@ -276,7 +273,7 @@ tcp_usr_disconnect(struct socket *so) * of the peer, storing through addr. */ static int -tcp_usr_accept(struct socket *so, struct mbuf *nam) +tcp_usr_accept(struct socket *so, struct sockaddr **nam) { int s = splnet(); int error = 0; @@ -328,8 +325,8 @@ tcp_usr_rcvd(struct socket *so, int flags) * marker if URG set. Possibly send more data. */ static int -tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *nam, - struct mbuf *control, struct proc *p) +tcp_usr_send(struct socket *so, int flags, struct mbuf *m, + struct sockaddr *nam, struct mbuf *control, struct proc *p) { int s = splnet(); int error = 0; @@ -475,20 +472,20 @@ struct pr_usrreqs tcp_usrreqs = { static int tcp_connect(tp, nam, p) register struct tcpcb *tp; - struct mbuf *nam; + struct sockaddr *nam; struct proc *p; { struct inpcb *inp = tp->t_inpcb, *oinp; struct socket *so = inp->inp_socket; struct tcpcb *otp; - struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); + struct sockaddr_in *sin = (struct sockaddr_in *)nam; struct sockaddr_in *ifaddr; int error; struct rmxp_tao *taop; struct rmxp_tao tao_noncached; if (inp->inp_lport == 0) { - error = in_pcbbind(inp, (struct mbuf *)0, p); + error = in_pcbbind(inp, (struct sockaddr *)0, p); if (error) return error; } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 108bea5..22b2450 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.37 1997/04/03 05:14:45 davidg Exp $ + * $Id: udp_usrreq.c,v 1.38 1997/04/27 20:01:16 wollman Exp $ */ #include <sys/param.h> @@ -90,7 +90,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 *, +static int udp_output __P((struct inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *)); static void udp_notify __P((struct inpcb *, int)); @@ -363,7 +363,8 @@ static int udp_output(inp, m, addr, control, p) register struct inpcb *inp; register struct mbuf *m; - struct mbuf *addr, *control; + struct sockaddr *addr; + struct mbuf *control; struct proc *p; { register struct udpiphdr *ui; @@ -445,7 +446,7 @@ udp_output(inp, m, addr, control, p) if (addr) { in_pcbdisconnect(inp); - inp->inp_laddr = laddr; + inp->inp_laddr = laddr; /* XXX rehash? */ splx(s); } return (error); @@ -503,7 +504,7 @@ udp_attach(struct socket *so, int proto, struct proc *p) } static int -udp_bind(struct socket *so, struct mbuf *nam, struct proc *p) +udp_bind(struct socket *so, struct sockaddr *nam, struct proc *p) { struct inpcb *inp; int s, error; @@ -518,7 +519,7 @@ udp_bind(struct socket *so, struct mbuf *nam, struct proc *p) } static int -udp_connect(struct socket *so, struct mbuf *nam, struct proc *p) +udp_connect(struct socket *so, struct sockaddr *nam, struct proc *p) { struct inpcb *inp; int s, error; @@ -572,7 +573,7 @@ udp_disconnect(struct socket *so) } static int -udp_send(struct socket *so, int flags, struct mbuf *m, struct mbuf *addr, +udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct proc *p) { struct inpcb *inp; diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index c9f22f5..4227219 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: udp_var.h,v 1.12 1997/02/22 09:41:44 peter Exp $ */ #ifndef _NETINET_UDP_VAR_H_ @@ -56,6 +56,16 @@ struct udpiphdr { #define ui_ulen ui_u.uh_ulen #define ui_sum ui_u.uh_sum +struct udpcb { + /* XXX - these should be by reference so we can do options quickly */ + struct ip udb_ip; + struct udphdr udb_uh; + struct sockaddr_in udb_conn; + struct in_hostcache *udb_hc; + struct mbuf *udb_queue; +}; +#define inptoudpcb(inp) ((struct udpdb *)(inp)->inp_ppcb) + struct udpstat { /* input statistics: */ u_long udps_ipackets; /* total input packets */ @@ -69,6 +79,7 @@ struct udpstat { u_long udpps_pcbhashmiss; /* input packets not for hashed pcb */ /* output statistics: */ u_long udps_opackets; /* total output packets */ + u_long udps_fastout; /* output packets on fast path */ }; /* |