MCPcopy Create free account
hub / github.com/F-Stack/f-stack / del_route_mpath

Function del_route_mpath

freebsd/net/route/mpath_ctl.c:163–189  ·  view source on GitHub ↗

* Tries to delete matching paths from @nhg. * Returns 0 on success and updates operation result in @rc. */

Source from the content-addressed store, hash-verified

161 * Returns 0 on success and updates operation result in @rc.
162 */
163int
164del_route_mpath(struct rib_head *rh, struct rt_addrinfo *info,
165 struct rtentry *rt, struct nhgrp_object *nhg,
166 struct rib_cmd_info *rc)
167{
168 struct route_nhop_data rnd;
169 struct rt_match_info ri = { .info = info, .rt = rt };
170 int error;
171
172 RIB_WLOCK_ASSERT(rh);
173
174 /*
175 * Require gateway to delete multipath routes, to forbid
176 * deleting all paths at once.
177 * If the filter function is provided, skip gateway check to
178 * allow rib_walk_del() delete routes for any criteria based
179 * on provided callback.
180 */
181 if ((info->rti_info[RTAX_GATEWAY] == NULL) && (info->rti_filter == NULL))
182 return (ESRCH);
183
184 error = nhgrp_get_filtered_group(rh, nhg, gw_filter_func, (void *)&ri,
185 &rnd);
186 if (error == 0)
187 error = change_route_nhop(rh, rt, info, &rnd, rc);
188 return (error);
189}
190

Callers 1

rt_unlinkrteFunction · 0.85

Calls 2

nhgrp_get_filtered_groupFunction · 0.85
change_route_nhopFunction · 0.85

Tested by

no test coverage detected