|
|
|
@ -135,7 +135,7 @@ static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr) { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, int type, int family, int flags) { |
|
|
|
|
static struct addrinfo* udp_resolve_host(const char *hostname, int port, int type, int family, int flags) { |
|
|
|
|
struct addrinfo hints, *res = 0; |
|
|
|
|
int error; |
|
|
|
|
char sport[16]; |
|
|
|
@ -153,7 +153,7 @@ static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, in |
|
|
|
|
hints.ai_family = family; |
|
|
|
|
hints.ai_flags = flags; |
|
|
|
|
if ((error = getaddrinfo(node, service, &hints, &res))) { |
|
|
|
|
av_log(NULL, AV_LOG_ERROR, "udp_ipv6_resolve_host: %s\n", gai_strerror(error)); |
|
|
|
|
av_log(NULL, AV_LOG_ERROR, "udp_resolve_host: %s\n", gai_strerror(error)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
@ -163,7 +163,7 @@ static int udp_set_url(struct sockaddr_storage *addr, const char *hostname, int |
|
|
|
|
struct addrinfo *res0; |
|
|
|
|
int addr_len; |
|
|
|
|
|
|
|
|
|
res0 = udp_ipv6_resolve_host(hostname, port, SOCK_DGRAM, AF_UNSPEC, 0); |
|
|
|
|
res0 = udp_resolve_host(hostname, port, SOCK_DGRAM, AF_UNSPEC, 0); |
|
|
|
|
if (res0 == 0) return AVERROR(EIO); |
|
|
|
|
memcpy(addr, res0->ai_addr, res0->ai_addrlen); |
|
|
|
|
addr_len = res0->ai_addrlen; |
|
|
|
@ -194,7 +194,7 @@ static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, int * |
|
|
|
|
|
|
|
|
|
if (((struct sockaddr *) &s->dest_addr)->sa_family) |
|
|
|
|
family = ((struct sockaddr *) &s->dest_addr)->sa_family; |
|
|
|
|
res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, family, AI_PASSIVE); |
|
|
|
|
res0 = udp_resolve_host(0, s->local_port, SOCK_DGRAM, family, AI_PASSIVE); |
|
|
|
|
if (res0 == 0) |
|
|
|
|
goto fail; |
|
|
|
|
for (res = res0; res; res=res->ai_next) { |
|
|
|
|