rm user.h, reg.h; pass proc to rtioctl
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 21 Apr 1991 07:34:07 +0000 (23:34 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 21 Apr 1991 07:34:07 +0000 (23:34 -0800)
SCCS-vsn: sys/net/route.c 7.20

usr/src/sys/net/route.c

index 192c964..7954ac8 100644 (file)
@@ -4,32 +4,30 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)route.c     7.19 (Berkeley) %G%
+ *     @(#)route.c     7.20 (Berkeley) %G%
  */
  */
-#include "machine/reg.h"
 #include "param.h"
 #include "systm.h"
 #include "param.h"
 #include "systm.h"
-#include "user.h"
 #include "proc.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "domain.h"
 #include "protosw.h"
 #include "proc.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "domain.h"
 #include "protosw.h"
-#include "errno.h"
 #include "ioctl.h"
 
 #include "if.h"
 #include "af.h"
 #include "route.h"
 #include "raw_cb.h"
 #include "ioctl.h"
 
 #include "if.h"
 #include "af.h"
 #include "route.h"
 #include "raw_cb.h"
+
 #include "../netinet/in.h"
 #include "../netinet/in_var.h"
 
 #include "../netns/ns.h"
 #include "machine/mtpr.h"
 #include "netisr.h"
 #include "../netinet/in.h"
 #include "../netinet/in_var.h"
 
 #include "../netns/ns.h"
 #include "machine/mtpr.h"
 #include "netisr.h"
+
 #define        SA(p) ((struct sockaddr *)(p))
 
 int    rttrash;                /* routes not in table but not freed */
 #define        SA(p) ((struct sockaddr *)(p))
 
 int    rttrash;                /* routes not in table but not freed */
@@ -39,6 +37,7 @@ int   rthashsize = RTHASHSIZ; /* for netstat, etc. */
 static int rtinits_done = 0;
 struct radix_node_head *ns_rnhead, *in_rnhead;
 struct radix_node *rn_match(), *rn_delete(), *rn_addroute();
 static int rtinits_done = 0;
 struct radix_node_head *ns_rnhead, *in_rnhead;
 struct radix_node *rn_match(), *rn_delete(), *rn_addroute();
+
 rtinitheads()
 {
        if (rtinits_done == 0 &&
 rtinitheads()
 {
        if (rtinits_done == 0 &&
@@ -200,9 +199,10 @@ done:
 /*
 * Routing table ioctl interface.
 */
 /*
 * Routing table ioctl interface.
 */
-rtioctl(req, data)
+rtioctl(req, data, p)
        int req;
        caddr_t data;
        int req;
        caddr_t data;
+       struct proc *p;
 {
 #ifndef COMPAT_43
        return (EOPNOTSUPP);
 {
 #ifndef COMPAT_43
        return (EOPNOTSUPP);
@@ -218,7 +218,7 @@ rtioctl(req, data)
        else
                return (EINVAL);
 
        else
                return (EINVAL);
 
-       if (error = suser(u.u_cred, &u.u_acflag))
+       if (error = suser(p->p_ucred, &p->p_acflag))
                return (error);
 #if BYTE_ORDER != BIG_ENDIAN
        if (entry->rt_dst.sa_family == 0 && entry->rt_dst.sa_len < 16) {
                return (error);
 #if BYTE_ORDER != BIG_ENDIAN
        if (entry->rt_dst.sa_family == 0 && entry->rt_dst.sa_len < 16) {