summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-08 15:05:45 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-01-08 15:05:45 +0000
commited06d88fbebbc128f0c227da18d3435344aa5b71 (patch)
tree577d19629e99c3e493b4521f0bacd208d1ac08ae
parent6571bb75613e41eb1a6ea1f65cc04b539cb7159e (diff)
Include the Routing Table ID in "struct rtentry" and reorder the fields
such that there's no size change on, at least, amd64. This will allow us to simplify some APIs and deprecate the remaining flavors of "struct route". ok claudio@, phessler@
-rw-r--r--sys/net/route.c3
-rw-r--r--sys/net/route.h25
2 files changed, 15 insertions, 13 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 427656a13c7..4e7cd6c476e 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.197 2015/01/08 14:29:18 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.198 2015/01/08 15:05:44 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -830,6 +830,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
return (ENOBUFS);
rt->rt_flags = info->rti_flags;
+ rt->rt_tableid = tableid;
if (prio == 0)
prio = ifa->ifa_ifp->if_priority + RTP_STATIC;
diff --git a/sys/net/route.h b/sys/net/route.h
index 6fb9659b2cf..62a910faeea 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.102 2015/01/08 14:29:18 mpi Exp $ */
+/* $OpenBSD: route.h,v 1.103 2015/01/08 15:05:44 mpi Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -99,19 +99,20 @@ struct rtentry {
struct radix_node rt_nodes[2]; /* tree glue, and other values */
#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
- struct sockaddr *rt_gateway; /* value */
- u_int rt_flags; /* up/down?, host/net */
- int rt_refcnt; /* # held references */
- struct ifnet *rt_ifp; /* the answer: interface to use */
- struct ifaddr *rt_ifa; /* the answer: interface addr to use */
- caddr_t rt_llinfo; /* pointer to link level info cache or
+ struct sockaddr *rt_gateway; /* value */
+ struct ifnet *rt_ifp; /* the answer: interface to use */
+ 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 */
- struct rt_kmetrics rt_rmx; /* metrics used by rx'ing protocols */
- struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
- struct rtentry *rt_parent; /* If cloned, parent of this route. */
+ struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */
+ struct rtentry *rt_parent; /* If cloned, parent of this route. */
LIST_HEAD(, rttimer) rt_timer; /* queue of timeouts for misc funcs */
- u_int16_t rt_labelid; /* route label ID */
- u_int8_t rt_priority; /* routing priority to use */
+ struct rt_kmetrics rt_rmx; /* metrics used by rx'ing protocols */
+ unsigned int rt_flags; /* up/down?, host/net */
+ unsigned int rt_tableid; /* routing table ID */
+ int rt_refcnt; /* # held references */
+ uint16_t rt_labelid; /* route label ID */
+ uint8_t rt_priority; /* routing priority to use */
};
#define rt_use rt_rmx.rmx_pksent
#define rt_expire rt_rmx.rmx_expire