From: mpi Date: Thu, 8 Jan 2015 15:05:44 +0000 (+0000) Subject: Include the Routing Table ID in "struct rtentry" and reorder the fields X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fa6c7e6bbd4028141ead8f8882462f15b04efca8;p=openbsd 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@ --- 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