Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156783399
D56189.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56189.id.diff
View Options
diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -1183,6 +1183,26 @@
return (error);
}
+static void
+update_tmproutes_mpath(struct rib_head *rnh, struct rtentry *rt,
+ struct route_nhop_data *rnd)
+{
+ const struct weightened_nhop *wn;
+ uint32_t i, nhops;
+
+ if (NH_IS_NHGRP(rnd->rnd_nhop)) {
+ wn = nhgrp_get_nhops(rnd->rnd_nhgrp, &nhops);
+
+ for (i = 0; i < nhops; i++) {
+ if (nhop_get_expire(wn[i].nh) == 0)
+ continue;
+
+ tmproutes_update(rnh, rt, wn[i].nh);
+ }
+ } else if (nhop_get_expire(rnd->rnd_nhop) != 0)
+ tmproutes_update(rnh, rt, rnd->rnd_nhop);
+}
+
/*
* Insert @rt with nhop data from @rnd_new to @rnh.
* Returns 0 on success and stores operation results in @rc.
@@ -1200,9 +1220,7 @@
rn = rnh->rnh_addaddr(rt_key(rt), rt_mask_const(rt), &rnh->head, rt->rt_nodes);
if (rn != NULL) {
- if (!NH_IS_NHGRP(rnd->rnd_nhop) && nhop_get_expire(rnd->rnd_nhop))
- tmproutes_update(rnh, rt, rnd->rnd_nhop);
-
+ update_tmproutes_mpath(rnh, rt, rnd);
/* Finalize notification */
rib_bump_gen(rnh);
rnh->rnh_prefixes++;
@@ -1272,8 +1290,7 @@
/* Changing nexthop & weight to a new one */
rt->rt_nhop = rnd->rnd_nhop;
rt->rt_weight = rnd->rnd_weight;
- if (!NH_IS_NHGRP(rnd->rnd_nhop) && nhop_get_expire(rnd->rnd_nhop))
- tmproutes_update(rnh, rt, rnd->rnd_nhop);
+ update_tmproutes_mpath(rnh, rt, rnd);
/* Finalize notification */
rib_bump_gen(rnh);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 17, 8:35 AM (8 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30682403
Default Alt Text
D56189.id.diff (1 KB)
Attached To
Mode
D56189: routing: Expire nhops inside the nhgrp
Attached
Detach File
Event Timeline
Log In to Comment