MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pfr_unroute_kentry

Function pfr_unroute_kentry

freebsd/netpfil/pf/pf_table.c:984–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

982}
983
984static int
985pfr_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
1009static void
1010pfr_copyout_addr(struct pfr_addr *ad, const struct pfr_kentry *ke)

Callers 2

pfr_remove_kentriesFunction · 0.85
pfr_clean_node_maskFunction · 0.85

Calls 3

pfr_prepare_networkFunction · 0.85
rn_deleteFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected