| 4594 | */ |
| 4595 | #ifdef INET6 |
| 4596 | uint32_t |
| 4597 | sctp_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 |
no test coverage detected