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

Function sctp_is_same_scope

freebsd/netinet/sctputil.c:4596–4619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4594 */
4595#ifdef INET6
4596uint32_t
4597sctp_is_same_scope(struct sockaddr_in6 *addr1, struct sockaddr_in6 *addr2)
4598{
4599 struct sockaddr_in6 a, b;
4600
4601 /* save copies */
4602 a = *addr1;
4603 b = *addr2;
4604
4605 if (a.sin6_scope_id == 0)
4606 if (sa6_recoverscope(&a)) {
4607 /* can't get scope, so can't match */
4608 return (0);
4609 }
4610 if (b.sin6_scope_id == 0)
4611 if (sa6_recoverscope(&b)) {
4612 /* can't get scope, so can't match */
4613 return (0);
4614 }
4615 if (a.sin6_scope_id != b.sin6_scope_id)
4616 return (0);
4617
4618 return (1);
4619}
4620
4621/*
4622 * returns a sockaddr_in6 with embedded scope recovered and removed

Callers 1

sctp_is_scopeid_in_netsFunction · 0.85

Calls 1

sa6_recoverscopeFunction · 0.85

Tested by

no test coverage detected