mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-02 09:09:59 +02:00
avserver: Fix a bug where the socket is IPv4, but IPv6 is autoselected for the loopback address.
This fixes bind(8080): Address family not supported by protocol. Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
e81e5e8ad2
commit
f5e717f3c7
@ -522,6 +522,7 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
|
|||||||
tmp = 1;
|
tmp = 1;
|
||||||
setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
|
setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp));
|
||||||
|
|
||||||
|
my_addr->sin_family = AF_INET;
|
||||||
if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {
|
if (bind (server_fd, (struct sockaddr *) my_addr, sizeof (*my_addr)) < 0) {
|
||||||
char bindmsg[32];
|
char bindmsg[32];
|
||||||
snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));
|
snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));
|
||||||
|
Loading…
Reference in New Issue
Block a user