| 767 | } |
| 768 | |
| 769 | inline sockaddr const * |
| 770 | NetVConnection::get_local_addr() |
| 771 | { |
| 772 | if (!got_local_addr) { |
| 773 | set_local_addr(); |
| 774 | if ((ats_is_ip(&local_addr) && ats_ip_port_cast(&local_addr)) // IP and has a port. |
| 775 | || (ats_is_ip4(&local_addr) && INADDR_ANY != ats_ip4_addr_cast(&local_addr)) // IPv4 |
| 776 | || (ats_is_ip6(&local_addr) && !IN6_IS_ADDR_UNSPECIFIED(&local_addr.sin6.sin6_addr))) { |
| 777 | got_local_addr = true; |
| 778 | } |
| 779 | } |
| 780 | return &local_addr.sa; |
| 781 | } |
| 782 | |
| 783 | /// @return The local port in host order. |
| 784 | inline uint16_t |
no test coverage detected