aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2011-09-27 18:48:43 -0600
committerReinhard Tartler <siretart@tauware.de>2012-01-05 22:26:55 +0100
commit06df5420670013c43c074aa402cc2a418d6ba502 (patch)
tree50582581136f63707c7e64e2f4a744bac5e758b6
parent82a11fcff24d9827070d77f1a3c6ba5d4dc12984 (diff)
downloadffmpeg-06df5420670013c43c074aa402cc2a418d6ba502.tar.gz
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> (cherry picked from commit f5e717f3c735af5c941b458d42615c97028aa916) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--ffserver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c
index 179cac4d96..bab58d1532 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -516,6 +516,7 @@ static int socket_open_listen(struct sockaddr_in *my_addr)
tmp = 1;
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) {
char bindmsg[32];
snprintf(bindmsg, sizeof(bindmsg), "bind(port %d)", ntohs(my_addr->sin_port));