From ab85b059e1f373aa9ff2f5ea16d571e562089221 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 27 May 1983 20:47:27 -0800 Subject: [PATCH] merge wnj changes plus lint SCCS-vsn: sys/netinet/tcp_usrreq.c 1.78 SCCS-vsn: sys/netinet/udp_usrreq.c 4.48 --- usr/src/sys/netinet/tcp_usrreq.c | 18 +++++++++++++----- usr/src/sys/netinet/udp_usrreq.c | 14 +++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/usr/src/sys/netinet/tcp_usrreq.c b/usr/src/sys/netinet/tcp_usrreq.c index 1658d7d024..229cbfc0e1 100644 --- a/usr/src/sys/netinet/tcp_usrreq.c +++ b/usr/src/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* tcp_usrreq.c 1.77 83/05/13 */ +/* tcp_usrreq.c 1.78 83/05/27 */ #include "../h/param.h" #include "../h/systm.h" @@ -29,6 +29,7 @@ */ extern char *tcpstates[]; struct tcpcb *tcp_newtcpcb(); +int tcpsenderrors; /* * Process a TCP user request for TCP tb. If this is a send request @@ -36,10 +37,10 @@ struct tcpcb *tcp_newtcpcb(); * (called from the software clock routine), then timertype tells which timer. */ /*ARGSUSED*/ -tcp_usrreq(so, req, m, nam) +tcp_usrreq(so, req, m, nam, rights) struct socket *so; int req; - struct mbuf *m, *nam; + struct mbuf *m, *nam, *rights; { register struct inpcb *inp = sotoinpcb(so); register struct tcpcb *tp; @@ -47,6 +48,10 @@ tcp_usrreq(so, req, m, nam) int error = 0; int ostate; + if (rights && rights->m_len) { + splx(s); + return (EINVAL); + } /* * When a TCP is attached to a socket, then there will be * a (struct inpcb) pointed at by the socket, and this @@ -205,8 +210,11 @@ tcp_usrreq(so, req, m, nam) tp->snd_end = tp->snd_una + so->so_snd.sb_cc; #endif error = tcp_output(tp); - if (error == ENOBUFS) /* XXX */ - error = 0; /* XXX */ + if (error) { /* XXX fix to use other path */ + if (error == ENOBUFS) /* XXX */ + error = 0; /* XXX */ + tcpsenderrors++; + } break; /* diff --git a/usr/src/sys/netinet/udp_usrreq.c b/usr/src/sys/netinet/udp_usrreq.c index 4e96d39011..7ef9080cd4 100644 --- a/usr/src/sys/netinet/udp_usrreq.c +++ b/usr/src/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* udp_usrreq.c 4.47 83/05/12 */ +/* udp_usrreq.c 4.48 83/05/27 */ #include "../h/param.h" #include "../h/dir.h" @@ -105,7 +105,8 @@ udp_input(m0) udp_in.sin_addr = ui->ui_src; m->m_len -= sizeof (struct udpiphdr); m->m_off += sizeof (struct udpiphdr); - if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in, m) == 0) + if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in, + m, (struct mbuf *)0) == 0) goto bad; sorwakeup(inp->inp_socket); return; @@ -204,14 +205,18 @@ udp_output(inp, m0) } /*ARGSUSED*/ -udp_usrreq(so, req, m, nam) +udp_usrreq(so, req, m, nam, rights) struct socket *so; int req; - struct mbuf *m, *nam; + struct mbuf *m, *nam, *rights; { struct inpcb *inp = sotoinpcb(so); int error = 0; + if (rights && rights->m_len) { + error = EINVAL; + goto release; + } if (inp == NULL && req != PRU_ATTACH) { error = EINVAL; goto release; @@ -313,7 +318,6 @@ udp_usrreq(so, req, m, nam) default: printf("request %d\n", req); - panic("udp_usrreq"); case PRU_RCVD: case PRU_CONTROL: -- 2.20.1