| 824 | } |
| 825 | |
| 826 | static int |
| 827 | del_route(struct rib_head *rnh, struct rt_addrinfo *info, |
| 828 | struct rib_cmd_info *rc) |
| 829 | { |
| 830 | int error; |
| 831 | |
| 832 | RIB_WLOCK(rnh); |
| 833 | error = rt_unlinkrte(rnh, info, rc); |
| 834 | RIB_WUNLOCK(rnh); |
| 835 | if (error != 0) |
| 836 | return (error); |
| 837 | |
| 838 | rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); |
| 839 | |
| 840 | /* |
| 841 | * If the caller wants it, then it can have it, |
| 842 | * the entry will be deleted after the end of the current epoch. |
| 843 | */ |
| 844 | if (rc->rc_cmd == RTM_DELETE) |
| 845 | rtfree(rc->rc_rt); |
| 846 | #ifdef ROUTE_MPATH |
| 847 | else { |
| 848 | /* |
| 849 | * Deleting 1 path may result in RTM_CHANGE to |
| 850 | * a different mpath group/nhop. |
| 851 | * Free old mpath group. |
| 852 | */ |
| 853 | nhop_free_any(rc->rc_nh_old); |
| 854 | } |
| 855 | #endif |
| 856 | |
| 857 | return (0); |
| 858 | } |
| 859 | |
| 860 | int |
| 861 | rib_change_route(uint32_t fibnum, struct rt_addrinfo *info, |
no test coverage detected