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

Function delete_addrsel_policyent

freebsd/netinet6/in6_src.c:1122–1151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120}
1121
1122static int
1123delete_addrsel_policyent(struct in6_addrpolicy *key)
1124{
1125 struct addrsel_policyent *pol;
1126
1127 ADDRSEL_XLOCK();
1128 ADDRSEL_LOCK();
1129
1130 /* search for the entry in the table */
1131 TAILQ_FOREACH(pol, &V_addrsel_policytab, ape_entry) {
1132 if (IN6_ARE_ADDR_EQUAL(&key->addr.sin6_addr,
1133 &pol->ape_policy.addr.sin6_addr) &&
1134 IN6_ARE_ADDR_EQUAL(&key->addrmask.sin6_addr,
1135 &pol->ape_policy.addrmask.sin6_addr)) {
1136 break;
1137 }
1138 }
1139 if (pol == NULL) {
1140 ADDRSEL_UNLOCK();
1141 ADDRSEL_XUNLOCK();
1142 return (ESRCH);
1143 }
1144
1145 TAILQ_REMOVE(&V_addrsel_policytab, pol, ape_entry);
1146 ADDRSEL_UNLOCK();
1147 ADDRSEL_XUNLOCK();
1148 free(pol, M_IFADDR);
1149
1150 return (0);
1151}
1152
1153static int
1154walk_addrsel_policy(int (*callback)(struct in6_addrpolicy *, void *), void *w)

Callers 1

in6_src_ioctlFunction · 0.85

Calls 1

freeFunction · 0.50

Tested by

no test coverage detected