checkFamily returns true iff the specified address family may be used with the socket. If exact is true, then the specified address family must be an exact match with the socket's family.
(family uint16, exact bool)
| 770 | // If exact is true, then the specified address family must be an exact match |
| 771 | // with the socket's family. |
| 772 | func (s *sock) checkFamily(family uint16, exact bool) bool { |
| 773 | if family == uint16(s.family) { |
| 774 | return true |
| 775 | } |
| 776 | if !exact && family == linux.AF_INET && s.family == linux.AF_INET6 { |
| 777 | if !s.Endpoint.SocketOptions().GetV6Only() { |
| 778 | return true |
| 779 | } |
| 780 | } |
| 781 | return false |
| 782 | } |
| 783 | |
| 784 | // mapFamily maps the AF_INET ANY address to the IPv4-mapped IPv6 ANY if the |
| 785 | // receiver's family is AF_INET6. |
no test coverage detected