| 982 | } |
| 983 | |
| 984 | static int |
| 985 | pfr_unroute_kentry(struct pfr_ktable *kt, struct pfr_kentry *ke) |
| 986 | { |
| 987 | union sockaddr_union mask; |
| 988 | struct radix_node *rn; |
| 989 | struct radix_head *head = NULL; |
| 990 | |
| 991 | if (ke->pfrke_af == AF_INET) |
| 992 | head = &kt->pfrkt_ip4->rh; |
| 993 | else if (ke->pfrke_af == AF_INET6) |
| 994 | head = &kt->pfrkt_ip6->rh; |
| 995 | |
| 996 | if (KENTRY_NETWORK(ke)) { |
| 997 | pfr_prepare_network(&mask, ke->pfrke_af, ke->pfrke_net); |
| 998 | rn = rn_delete(&ke->pfrke_sa, &mask, head); |
| 999 | } else |
| 1000 | rn = rn_delete(&ke->pfrke_sa, NULL, head); |
| 1001 | |
| 1002 | if (rn == NULL) { |
| 1003 | printf("pfr_unroute_kentry: delete failed.\n"); |
| 1004 | return (-1); |
| 1005 | } |
| 1006 | return (0); |
| 1007 | } |
| 1008 | |
| 1009 | static void |
| 1010 | pfr_copyout_addr(struct pfr_addr *ad, const struct pfr_kentry *ke) |
no test coverage detected