Lines Matching refs:sock
1294 int sock; in _find_src_addr() local
1310 sock = socket(addr->sa_family, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP); in _find_src_addr()
1311 if (sock == -1) { in _find_src_addr()
1318 if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0) { in _find_src_addr()
1319 close(sock); in _find_src_addr()
1322 if (uid > 0 && uid != NET_CONTEXT_INVALID_UID && fchown(sock, uid, (gid_t) -1) < 0) { in _find_src_addr()
1323 close(sock); in _find_src_addr()
1327 ret = connect(sock, addr, len); in _find_src_addr()
1331 close(sock); in _find_src_addr()
1335 if (src_addr && getsockname(sock, src_addr, &len) == -1) { in _find_src_addr()
1336 close(sock); in _find_src_addr()
1339 close(sock); in _find_src_addr()