diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-25 11:58:12 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-10-25 11:58:12 +0000 |
commit | d7c02826bd0518fa3ad0c9ac4f00ba148683d42c (patch) | |
tree | fdfcead87b08eab5fe3ac46953117a34ba7dedb9 /sys/net/route.c | |
parent | 6fba9838094cca457e322bfa0e2e395449e078d9 (diff) |
Introduce if_rtrequest() the successor of ifa_rtrequest().
L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''. Not having to care about an ``ifa'' makes our life easier
in our MP effort. Fewer dependencies between data structures implies
fewer headaches.
Discussed with bluhm@, ok claudio@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 804a33b4071..740cf242852 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.261 2015/10/25 10:05:09 bluhm Exp $ */ +/* $OpenBSD: route.c,v 1.262 2015/10/25 11:58:11 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -782,8 +782,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, rt->rt_parent = NULL; rt->rt_flags &= ~RTF_UP; - if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest) - ifa->ifa_rtrequest(RTM_DELETE, rt); + rt->rt_ifp->if_rtrequest(rt->rt_ifp, RTM_DELETE, rt); atomic_inc_int(&rttrash); if (ret_nrt != NULL) @@ -922,15 +921,14 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, if ((*ret_nrt)->rt_ifa->ifa_ifp == NULL) { printf("rtrequest1 RTM_RESOLVE: wrong ifa (%p) " "was (%p)\n", ifa, (*ret_nrt)->rt_ifa); - if ((*ret_nrt)->rt_ifa->ifa_rtrequest) - (*ret_nrt)->rt_ifa->ifa_rtrequest( - RTM_DELETE, *ret_nrt); + (*ret_nrt)->rt_ifp->if_rtrequest(rt->rt_ifp, + RTM_DELETE, *ret_nrt); ifafree((*ret_nrt)->rt_ifa); (*ret_nrt)->rt_ifa = ifa; (*ret_nrt)->rt_ifp = ifa->ifa_ifp; ifa->ifa_refcnt++; - if (ifa->ifa_rtrequest) - ifa->ifa_rtrequest(RTM_ADD, *ret_nrt); + (*ret_nrt)->rt_ifp->if_rtrequest(rt->rt_ifp, + RTM_ADD, *ret_nrt); } /* * Copy both metrics and a back pointer to the cloned @@ -978,9 +976,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, pool_put(&rtentry_pool, rt); return (EEXIST); } - - if (ifa->ifa_rtrequest) - ifa->ifa_rtrequest(req, rt); + rt->rt_ifp->if_rtrequest(rt->rt_ifp, req, rt); if ((rt->rt_flags & RTF_CLONING) != 0) { /* clean up any cloned children */ |