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.h | |
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.h')
-rw-r--r-- | sys/net/route.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/route.h b/sys/net/route.h index ae58d77269e..4cdd6b8da6c 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $OpenBSD: route.h,v 1.126 2015/12/02 16:35:53 bluhm Exp $ */ +/* $OpenBSD: route.h,v 1.127 2015/12/03 14:19:55 mpi Exp $ */ /* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */ /* @@ -102,8 +102,6 @@ struct rtentry { struct srpl_entry rt_next; /* Next multipath entry to our dst. */ #endif struct sockaddr *rt_gateway; /* value */ - struct ifnet *rt_ifp; /* the answer: interface to use */ -#define rt_ifidx rt_ifp->if_index struct ifaddr *rt_ifa; /* the answer: interface addr to use */ caddr_t rt_llinfo; /* pointer to link level info cache or to an MPLS structure */ @@ -111,6 +109,7 @@ struct rtentry { struct rtentry *rt_parent; /* If cloned, parent of this route. */ LIST_HEAD(, rttimer) rt_timer; /* queue of timeouts for misc funcs */ struct rt_kmetrics rt_rmx; /* metrics used by rx'ing protocols */ + unsigned int rt_ifidx; /* the answer: interface to use */ unsigned int rt_flags; /* up/down?, host/net */ unsigned int rt_tableid; /* routing table ID */ int rt_refcnt; /* # held references */ @@ -345,10 +344,11 @@ void rtlabel_unref(u_int16_t); extern struct rtstat rtstat; extern const struct sockaddr_rtin rt_defmask4; -struct mbuf; -struct socket; -void route_init(void); +struct mbuf; +struct socket; +struct ifnet; +void route_init(void); int route_output(struct mbuf *, ...); int route_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *); |