Lines Matching refs:sock
1789 int sock; in _find_src_addr() local
1805 sock = socket(addr->sa_family, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP); in _find_src_addr()
1806 if (sock == -1) { in _find_src_addr()
1813 if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0) { in _find_src_addr()
1814 close(sock); in _find_src_addr()
1817 if (uid > 0 && uid != NET_CONTEXT_INVALID_UID && fchown(sock, uid, (gid_t)-1) < 0) { in _find_src_addr()
1818 close(sock); in _find_src_addr()
1822 ret = __connect(sock, addr, len); in _find_src_addr()
1826 close(sock); in _find_src_addr()
1830 if (src_addr && getsockname(sock, src_addr, &len) == -1) { in _find_src_addr()
1831 close(sock); in _find_src_addr()
1834 close(sock); in _find_src_addr()