| 1020 | #endif |
| 1021 | |
| 1022 | static int |
| 1023 | change_route(struct rib_head *rnh, struct rt_addrinfo *info, |
| 1024 | struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc) |
| 1025 | { |
| 1026 | int error = 0; |
| 1027 | struct nhop_object *nh, *nh_orig; |
| 1028 | struct route_nhop_data rnd_new; |
| 1029 | |
| 1030 | nh = NULL; |
| 1031 | nh_orig = rnd_orig->rnd_nhop; |
| 1032 | if (nh_orig == NULL) |
| 1033 | return (ESRCH); |
| 1034 | |
| 1035 | #ifdef ROUTE_MPATH |
| 1036 | if (NH_IS_NHGRP(nh_orig)) |
| 1037 | return (change_mpath_route(rnh, info, rnd_orig, rc)); |
| 1038 | #endif |
| 1039 | |
| 1040 | rnd_new.rnd_weight = get_info_weight(info, rnd_orig->rnd_weight); |
| 1041 | error = change_nhop(rnh, info, nh_orig, &rnd_new.rnd_nhop); |
| 1042 | if (error != 0) |
| 1043 | return (error); |
| 1044 | error = change_route_conditional(rnh, NULL, info, rnd_orig, &rnd_new, rc); |
| 1045 | |
| 1046 | return (error); |
| 1047 | } |
| 1048 | |
| 1049 | /* |
| 1050 | * Insert @rt with nhop data from @rnd_new to @rnh. |
no test coverage detected