diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-12-03 14:19:56 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-12-03 14:19:56 +0000 |
commit | 408a66936c0f91578d26258dc6f232569860e129 (patch) | |
tree | 27193fd588beb54421f10e497181897896247632 /sys/net/route.c | |
parent | d3f72f555df1d0f3b3cf927894fe87abac7d2c4c (diff) |
Store an interface index instead of a pointer in the "struct rtentry".
These indexes are unique and should be used with if_get() to get a
pointer to the corresponding ``ifp''. Such pointer is guaranteed to
be valid in a MP environment until if_put() is called.
ok claudio@, sthen@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 99a908064b1..d160dd7ec4e 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.283 2015/12/02 16:49:58 bluhm Exp $ */ +/* $OpenBSD: route.c,v 1.284 2015/12/03 14:19:55 mpi Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1009,7 +1009,7 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, ifa->ifa_refcnt++; rt->rt_ifa = ifa; - rt->rt_ifp = ifp; + rt->rt_ifidx = ifp->if_index; if (rt->rt_flags & RTF_CLONED) { /* * If the ifa of the cloning route was stale, a @@ -1031,7 +1031,7 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, ifa->ifa_refcnt++; (*ret_nrt)->rt_ifa = ifa; - (*ret_nrt)->rt_ifp = ifp; + (*ret_nrt)->rt_ifidx = ifp->if_index; ifp->if_rtrequest(ifp, RTM_ADD, *ret_nrt); } /* |