Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146209548
D24609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D24609.diff
View Options
Index: head/sys/net/radix_mpath.c
===================================================================
--- head/sys/net/radix_mpath.c
+++ head/sys/net/radix_mpath.c
@@ -183,6 +183,7 @@
struct sockaddr *netmask)
{
struct radix_node *rn, *rn1;
+ struct nhop_object *nh, *nh1;
struct rtentry *rt1;
rn = (struct radix_node *)rt;
@@ -198,15 +199,17 @@
if (rn1 == rn)
continue;
- if (rt1->rt_gateway->sa_family == AF_LINK) {
- if (rt1->rt_ifa->ifa_addr->sa_len != rt->rt_ifa->ifa_addr->sa_len ||
- bcmp(rt1->rt_ifa->ifa_addr, rt->rt_ifa->ifa_addr,
- rt1->rt_ifa->ifa_addr->sa_len))
+ nh = rt->rt_nhop;
+ nh1 = rt1->rt_nhop;
+
+ if (nh1->gw_sa.sa_family == AF_LINK) {
+ if (nh1->nh_ifa->ifa_addr->sa_len != nh->nh_ifa->ifa_addr->sa_len ||
+ bcmp(nh1->nh_ifa->ifa_addr, nh->nh_ifa->ifa_addr,
+ nh1->nh_ifa->ifa_addr->sa_len))
continue;
} else {
- if (rt1->rt_gateway->sa_len != rt->rt_gateway->sa_len ||
- bcmp(rt1->rt_gateway, rt->rt_gateway,
- rt1->rt_gateway->sa_len))
+ if (nh1->gw_sa.sa_len != nh->gw_sa.sa_len ||
+ bcmp(&nh1->gw_sa, &nh->gw_sa, nh1->gw_sa.sa_len))
continue;
}
Index: head/sys/net/route.c
===================================================================
--- head/sys/net/route.c
+++ head/sys/net/route.c
@@ -745,8 +745,8 @@
default:
break;
}
- if (!not_found && rt->rt_ifa != NULL) {
- ifa = rt->rt_ifa;
+ if (!not_found && rt->rt_nhop->nh_ifa != NULL) {
+ ifa = rt->rt_nhop->nh_ifa;
}
RT_REMREF(rt);
RT_UNLOCK(rt);
@@ -909,7 +909,7 @@
if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) {
rt = RNTORT(rn);
/* Ensure route & ifp is UP */
- if (RT_LINK_IS_UP(rt->rt_ifp)) {
+ if (RT_LINK_IS_UP(rt->rt_nhop->nh_ifp)) {
flags = (flags & NHR_REF) | NHR_COPY;
error = rt_exportinfo(rt, info, flags);
RIB_RUNLOCK(rh);
@@ -1064,7 +1064,8 @@
rt_notifydelete(rt, &di.info);
if (report)
- rt_routemsg(RTM_DELETE, rt, rt->rt_ifp, 0, fibnum);
+ rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0,
+ fibnum);
RTFREE_LOCKED(rt);
}
}
@@ -1237,7 +1238,7 @@
/*
* give the protocol a chance to keep things in sync.
*/
- ifa = rt->rt_ifa;
+ ifa = rt->rt_nhop->nh_ifa;
if (ifa != NULL && ifa->ifa_rtrequest != NULL)
ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info);
@@ -1863,7 +1864,7 @@
info->rti_info[RTAX_GATEWAY] != NULL) ||
info->rti_info[RTAX_IFP] != NULL ||
(info->rti_info[RTAX_IFA] != NULL &&
- !sa_equal(info->rti_info[RTAX_IFA], rt->rt_ifa->ifa_addr))) {
+ !sa_equal(info->rti_info[RTAX_IFA], rt->rt_nhop->nh_ifa->ifa_addr))) {
/*
* XXX: Temporarily set RTF_RNH_LOCKED flag in the rti_flags
* to avoid rlock in the ifa_ifwithroute().
@@ -2162,7 +2163,7 @@
#endif
error = (rn == NULL ||
(rn->rn_flags & RNF_ROOT) ||
- RNTORT(rn)->rt_ifa != ifa);
+ RNTORT(rn)->rt_nhop->nh_ifa != ifa);
RIB_RUNLOCK(rnh);
if (error) {
/* this is only an error if bad on ALL tables */
Index: head/sys/net/route/route_ddb.c
===================================================================
--- head/sys/net/route/route_ddb.c
+++ head/sys/net/route/route_ddb.c
@@ -131,18 +131,20 @@
{
struct sockaddr_storage ss;
struct rtentry *rt;
+ struct nhop_object *nh;
int flags, idx;
/* If RNTORT is important, put it in a header. */
rt = (void *)rn;
+ nh = (struct nhop_object *)rt->rt_nhop;
rt_dumpaddr_ddb("dst", rt_key(rt));
rt_dumpaddr_ddb("gateway", &rt->rt_nhop->gw_sa);
rt_dumpaddr_ddb("netmask", rtsock_fix_netmask(rt_key(rt), rt_mask(rt),
&ss));
- if (rt->rt_ifp != NULL && (rt->rt_ifp->if_flags & IFF_DYING) == 0) {
- rt_dumpaddr_ddb("ifp", rt->rt_ifp->if_addr->ifa_addr);
- rt_dumpaddr_ddb("ifa", rt->rt_ifa->ifa_addr);
+ if ((nh->nh_ifp->if_flags & IFF_DYING) == 0) {
+ rt_dumpaddr_ddb("ifp", nh->nh_ifp->if_addr->ifa_addr);
+ rt_dumpaddr_ddb("ifa", nh->nh_ifa->ifa_addr);
}
db_printf("flags ");
Index: head/sys/net/rtsock.c
===================================================================
--- head/sys/net/rtsock.c
+++ head/sys/net/rtsock.c
@@ -929,7 +929,7 @@
rti_need_deembed = (V_deembed_scopeid) ? 1 : 0;
#endif
RT_LOCK(saved_nrt);
- rtm->rtm_index = saved_nrt->rt_ifp->if_index;
+ rtm->rtm_index = saved_nrt->rt_nhop->nh_ifp->if_index;
RT_REMREF(saved_nrt);
RT_UNLOCK(saved_nrt);
}
@@ -1714,6 +1714,7 @@
{
struct walkarg *w = vw;
struct rtentry *rt = (struct rtentry *)rn;
+ struct nhop_object *nh;
int error = 0, size;
struct rt_addrinfo info;
struct sockaddr_storage ss;
@@ -1730,11 +1731,12 @@
info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt),
rt_mask(rt), &ss);
info.rti_info[RTAX_GENMASK] = 0;
- if (rt->rt_ifp && !(rt->rt_ifp->if_flags & IFF_DYING)) {
- info.rti_info[RTAX_IFP] = rt->rt_ifp->if_addr->ifa_addr;
- info.rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr;
- if (rt->rt_ifp->if_flags & IFF_POINTOPOINT)
- info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr;
+ nh = rt->rt_nhop;
+ if (nh->nh_ifp && !(nh->nh_ifp->if_flags & IFF_DYING)) {
+ info.rti_info[RTAX_IFP] = nh->nh_ifp->if_addr->ifa_addr;
+ info.rti_info[RTAX_IFA] = nh->nh_ifa->ifa_addr;
+ if (nh->nh_ifp->if_flags & IFF_POINTOPOINT)
+ info.rti_info[RTAX_BRD] = nh->nh_ifa->ifa_dstaddr;
}
if ((error = rtsock_msg_buffer(RTM_GET, &info, w, &size)) != 0)
return (error);
@@ -1748,8 +1750,9 @@
(rt->rt_flags & ~RTF_GWFLAG_COMPAT);
else
rtm->rtm_flags = rt->rt_flags;
+ rtm->rtm_flags |= nhop_get_rtflags(nh);
rt_getmetrics(rt, &rtm->rtm_rmx);
- rtm->rtm_index = rt->rt_ifp->if_index;
+ rtm->rtm_index = nh->nh_ifp->if_index;
rtm->rtm_addrs = info.rti_addrs;
error = SYSCTL_OUT(w->w_req, (caddr_t)rtm, size);
return (error);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 1, 6:50 PM (9 h, 27 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29122989
Default Alt Text
D24609.diff (5 KB)
Attached To
Mode
D24609: Convert one of the last rtentry field accesses into nhop fields accesses.
Attached
Detach File
Event Timeline
Log In to Comment