| 148 | } |
| 149 | |
| 150 | void |
| 151 | rt_table_destroy(struct rib_head *rh) |
| 152 | { |
| 153 | |
| 154 | RIB_WLOCK(rh); |
| 155 | rh->rib_dying = true; |
| 156 | RIB_WUNLOCK(rh); |
| 157 | |
| 158 | #ifdef FIB_ALGO |
| 159 | fib_destroy_rib(rh); |
| 160 | #endif |
| 161 | |
| 162 | tmproutes_destroy(rh); |
| 163 | |
| 164 | rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); |
| 165 | |
| 166 | nhops_destroy_rib(rh); |
| 167 | |
| 168 | rib_destroy_subscriptions(rh); |
| 169 | |
| 170 | /* Assume table is already empty */ |
| 171 | RIB_LOCK_DESTROY(rh); |
| 172 | free(rh, M_RTABLE); |
| 173 | } |
| 174 | |
| 175 | /* |
| 176 | * Adds a temporal redirect entry to the routing table. |
no test coverage detected