The code in tcp_input() to disallow a socket from connecting to itself
[unix-history] / usr / src / sys / net / raw_usrreq.c
index f5afef9..aa2b157 100644 (file)
@@ -1,45 +1,33 @@
 /*
 /*
- * Copyright (c) 1980, 1986 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  *
  *
- *     @(#)raw_usrreq.c        7.7 (Berkeley) %G%
+ *     @(#)raw_usrreq.c        8.1 (Berkeley) %G%
  */
 
  */
 
-#include "param.h"
-#include "mbuf.h"
-#include "domain.h"
-#include "protosw.h"
-#include "socket.h"
-#include "socketvar.h"
-#include "errno.h"
+#include <sys/param.h>
+#include <sys/mbuf.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+#include <sys/errno.h>
 
 
-#include "if.h"
-#include "route.h"
-#include "netisr.h"
-#include "raw_cb.h"
-
-#include "machine/mtpr.h"
+#include <net/if.h>
+#include <net/route.h>
+#include <net/netisr.h>
+#include <net/raw_cb.h>
 
 /*
  * Initialize raw connection block q.
  */
 
 /*
  * Initialize raw connection block q.
  */
+void
 raw_init()
 {
 
        rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
 raw_init()
 {
 
        rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
-       rawintrq.ifq_maxlen = IFQ_MAXLEN;
 }
 
 
 }
 
 
@@ -51,6 +39,7 @@ raw_init()
 /*
  * Raw protocol interface.
  */
 /*
  * Raw protocol interface.
  */
+void
 raw_input(m0, proto, src, dst)
        struct mbuf *m0;
        register struct sockproto *proto;
 raw_input(m0, proto, src, dst)
        struct mbuf *m0;
        register struct sockproto *proto;
@@ -107,10 +96,10 @@ raw_input(m0, proto, src, dst)
                }
        } else
                m_freem(m);
                }
        } else
                m_freem(m);
-       return (sockets);
 }
 
 /*ARGSUSED*/
 }
 
 /*ARGSUSED*/
+void
 raw_ctlinput(cmd, arg)
        int cmd;
        struct sockaddr *arg;
 raw_ctlinput(cmd, arg)
        int cmd;
        struct sockaddr *arg;
@@ -122,10 +111,11 @@ raw_ctlinput(cmd, arg)
 }
 
 /*ARGSUSED*/
 }
 
 /*ARGSUSED*/
-raw_usrreq(so, req, m, nam, rights, control)
+int
+raw_usrreq(so, req, m, nam, control)
        struct socket *so;
        int req;
        struct socket *so;
        int req;
-       struct mbuf *m, *nam, *rights, *control;
+       struct mbuf *m, *nam, *control;
 {
        register struct rawcb *rp = sotorawcb(so);
        register int error = 0;
 {
        register struct rawcb *rp = sotorawcb(so);
        register int error = 0;
@@ -133,7 +123,7 @@ raw_usrreq(so, req, m, nam, rights, control)
 
        if (req == PRU_CONTROL)
                return (EOPNOTSUPP);
 
        if (req == PRU_CONTROL)
                return (EOPNOTSUPP);
-       if (rights && rights->m_len) {
+       if (control && control->m_len) {
                error = EOPNOTSUPP;
                goto release;
        }
                error = EOPNOTSUPP;
                goto release;
        }
@@ -288,5 +278,3 @@ release:
                m_freem(m);
        return (error);
 }
                m_freem(m);
        return (error);
 }
-
-rawintr() {} /* XXX - referenced by locore.  will soon go away */