pass flags from device close to l_close
[unix-history] / usr / src / sys / net / route.c
index 192c964..dcee330 100644 (file)
@@ -4,32 +4,32 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)route.c     7.19 (Berkeley) %G%
+ *     @(#)route.c     7.21 (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 "../netinet/in.h"
 #include "../netinet/in_var.h"
 
+#ifdef NS
 #include "../netns/ns.h"
 #include "../netns/ns.h"
+#endif
 #include "machine/mtpr.h"
 #include "netisr.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,10 +39,13 @@ 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 &&
+#ifdef NS
            rn_inithead(&ns_rnhead, 16, AF_NS) &&
            rn_inithead(&ns_rnhead, 16, AF_NS) &&
+#endif
            rn_inithead(&in_rnhead, 32, AF_INET))
                rtinits_done = 1;
 }
            rn_inithead(&in_rnhead, 32, AF_INET))
                rtinits_done = 1;
 }
@@ -200,9 +203,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 +222,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) {