install correct aliases file
[unix-history] / usr / src / sys / net / raw_usrreq.c
index 7b61d30..c6a94e9 100644 (file)
@@ -1,4 +1,21 @@
-/*     raw_usrreq.c    6.7     85/06/02        */
+/*
+ * Copyright (c) 1980, 1986 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.
+ *
+ *     @(#)raw_usrreq.c        7.4 (Berkeley) %G%
+ */
 
 #include "param.h"
 #include "mbuf.h"
 
 #include "param.h"
 #include "mbuf.h"
@@ -13,7 +30,7 @@
 #include "netisr.h"
 #include "raw_cb.h"
 
 #include "netisr.h"
 #include "raw_cb.h"
 
-#include "../vax/mtpr.h"
+#include "../machine/mtpr.h"
 
 /*
  * Initialize raw connection block q.
 
 /*
  * Initialize raw connection block q.
@@ -136,7 +153,7 @@ next:
 /*ARGSUSED*/
 raw_ctlinput(cmd, arg)
        int cmd;
 /*ARGSUSED*/
 raw_ctlinput(cmd, arg)
        int cmd;
-       caddr_t arg;
+       struct sockaddr *arg;
 {
 
        if (cmd < 0 || cmd > PRC_NCMDS)
 {
 
        if (cmd < 0 || cmd > PRC_NCMDS)
@@ -153,6 +170,8 @@ raw_usrreq(so, req, m, nam, rights)
        register struct rawcb *rp = sotorawcb(so);
        register int error = 0;
 
        register struct rawcb *rp = sotorawcb(so);
        register int error = 0;
 
+       if (req == PRU_CONTROL)
+               return (EOPNOTSUPP);
        if (rights && rights->m_len) {
                error = EOPNOTSUPP;
                goto release;
        if (rights && rights->m_len) {
                error = EOPNOTSUPP;
                goto release;
@@ -224,8 +243,6 @@ raw_usrreq(so, req, m, nam, rights)
                        error = ENOTCONN;
                        break;
                }
                        error = ENOTCONN;
                        break;
                }
-               if (rp->rcb_route.ro_rt)
-                       rtfree(rp->rcb_route.ro_rt);
                raw_disconnect(rp);
                soisdisconnected(so);
                break;
                raw_disconnect(rp);
                soisdisconnected(so);
                break;
@@ -252,22 +269,6 @@ raw_usrreq(so, req, m, nam, rights)
                        error = ENOTCONN;
                        break;
                }
                        error = ENOTCONN;
                        break;
                }
-               /*
-                * Check for routing.  If new foreign address, or
-                * no route presently in use, try to allocate new
-                * route.  On failure, just hand packet to output
-                * routine anyway in case it can handle it.
-                */
-               if ((rp->rcb_flags & RAW_DONTROUTE) == 0)
-                       if (!equal(rp->rcb_faddr, rp->rcb_route.ro_dst) ||
-                           rp->rcb_route.ro_rt == 0) {
-                               if (rp->rcb_route.ro_rt) {
-                                       RTFREE(rp->rcb_route.ro_rt);
-                                       rp->rcb_route.ro_rt = NULL;
-                               }
-                               rp->rcb_route.ro_dst = rp->rcb_faddr;
-                               rtalloc(&rp->rcb_route);
-                       }
                error = (*so->so_proto->pr_output)(m, so);
                m = NULL;
                if (nam)
                error = (*so->so_proto->pr_output)(m, so);
                m = NULL;
                if (nam)
@@ -289,11 +290,11 @@ raw_usrreq(so, req, m, nam, rights)
        /*
         * Not supported.
         */
        /*
         * Not supported.
         */
-       case PRU_CONTROL:
        case PRU_RCVOOB:
        case PRU_RCVD:
                return(EOPNOTSUPP);
 
        case PRU_RCVOOB:
        case PRU_RCVD:
                return(EOPNOTSUPP);
 
+       case PRU_LISTEN:
        case PRU_ACCEPT:
        case PRU_SENDOOB:
                error = EOPNOTSUPP;
        case PRU_ACCEPT:
        case PRU_SENDOOB:
                error = EOPNOTSUPP;