X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/9bdb995186b1edb61d88682611b30c35366acdbf..fcd82046e6fb74888893eef7d78e1e947b22277e:/usr/src/sys/net/route.c diff --git a/usr/src/sys/net/route.c b/usr/src/sys/net/route.c index 192c964502..dcee3305ac 100644 --- a/usr/src/sys/net/route.c +++ b/usr/src/sys/net/route.c @@ -4,32 +4,32 @@ * * %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 "user.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 "../netinet/in.h" #include "../netinet/in_var.h" +#ifdef NS #include "../netns/ns.h" +#endif #include "machine/mtpr.h" #include "netisr.h" + #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(); + rtinitheads() { if (rtinits_done == 0 && +#ifdef NS rn_inithead(&ns_rnhead, 16, AF_NS) && +#endif rn_inithead(&in_rnhead, 32, AF_INET)) rtinits_done = 1; } @@ -200,9 +203,10 @@ done: /* * Routing table ioctl interface. */ -rtioctl(req, data) +rtioctl(req, data, p) int req; caddr_t data; + struct proc *p; { #ifndef COMPAT_43 return (EOPNOTSUPP); @@ -218,7 +222,7 @@ rtioctl(req, data) 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) {