* Tries to delete matching paths from @nhg. * Returns 0 on success and updates operation result in @rc. */
| 161 | * Returns 0 on success and updates operation result in @rc. |
| 162 | */ |
| 163 | int |
| 164 | del_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 |
no test coverage detected