diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-11-27 16:22:46 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-11-27 16:22:46 +0000 |
commit | 878b85bab54504f0210881ee32d3dc9ac088232e (patch) | |
tree | 7dfc062415efa89c01935fc07c0956f39778cfba /sys/net/rtsock.c | |
parent | 65b8e7f92145f4c4f69649a66db8d9a3133d299a (diff) |
don't let anything outside route.c access the routing table heads directly,
but go through a provided wrapper.
also provide rt_lookup() instead of doing the lookup manually in many places.
ryan ok
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r-- | sys/net/rtsock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index f550f99404b..8a6f5b18b6f 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.48 2005/06/08 06:43:07 henning Exp $ */ +/* $OpenBSD: rtsock.c,v 1.49 2005/11/27 16:22:45 henning Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -262,11 +262,11 @@ route_output(struct mbuf *m, ...) case RTM_GET: case RTM_CHANGE: case RTM_LOCK: - if ((rnh = rt_tables[dst->sa_family]) == 0) { + if (rt_gettable(dst->sa_family, 0) == NULL) { error = EAFNOSUPPORT; goto flush; } - rn = rnh->rnh_lookup(dst, netmask, rnh); + rn = rt_lookup(dst, netmask, 0); if (rn == NULL || (rn->rn_flags & RNF_ROOT) != 0) { error = ESRCH; goto flush; @@ -904,7 +904,7 @@ sysctl_rtable(int *name, u_int namelen, void *where, size_t *given, void *new, case NET_RT_DUMP: case NET_RT_FLAGS: for (i = 1; i <= AF_MAX; i++) - if ((rnh = rt_tables[i]) && (af == 0 || af == i) && + if ((rnh = rt_gettable(i, 0)) && (af == 0 || af == i) && (error = (*rnh->rnh_walktree)(rnh, sysctl_dumpentry, &w))) break; |