| 1170 | } |
| 1171 | |
| 1172 | int |
| 1173 | rn_detachhead(void **head) |
| 1174 | { |
| 1175 | struct radix_node_head *rnh; |
| 1176 | |
| 1177 | KASSERT((head != NULL && *head != NULL), |
| 1178 | ("%s: head already freed", __func__)); |
| 1179 | |
| 1180 | rnh = (struct radix_node_head *)(*head); |
| 1181 | |
| 1182 | rn_walktree(&rnh->rh.rnh_masks->head, rn_freeentry, rnh->rh.rnh_masks); |
| 1183 | rn_detachhead_internal(&rnh->rh.rnh_masks->head); |
| 1184 | rn_detachhead_internal(&rnh->rh); |
| 1185 | |
| 1186 | *head = NULL; |
| 1187 | |
| 1188 | return (1); |
| 1189 | } |
no test coverage detected