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

Function carp_iamatch6

freebsd/netinet/ip_carp.c:1181–1202  ·  view source on GitHub ↗

* Returns ifa in case it's a carp address and it is MASTER, or if the address * matches and is not a carp address. Returns NULL otherwise. */

Source from the content-addressed store, hash-verified

1179 * matches and is not a carp address. Returns NULL otherwise.
1180 */
1181struct ifaddr *
1182carp_iamatch6(struct ifnet *ifp, struct in6_addr *taddr)
1183{
1184 struct ifaddr *ifa;
1185
1186 NET_EPOCH_ASSERT();
1187
1188 ifa = NULL;
1189 CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
1190 if (ifa->ifa_addr->sa_family != AF_INET6)
1191 continue;
1192 if (!IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa)))
1193 continue;
1194 if (ifa->ifa_carp && ifa->ifa_carp->sc_state != MASTER)
1195 ifa = NULL;
1196 else
1197 ifa_ref(ifa);
1198 break;
1199 }
1200
1201 return (ifa);
1202}
1203
1204char *
1205carp_macmatch6(struct ifnet *ifp, struct mbuf *m, const struct in6_addr *taddr)

Callers

nothing calls this directly

Calls 1

ifa_refFunction · 0.85

Tested by

no test coverage detected