satip_server_bootid = time(NULL);
satip_server_conf.satip_deviceid = 1;
- if (tcp_server_bound(http_server, &http) < 0) {
+ if (tcp_server_bound(http_server, &http, PF_INET) < 0) {
tvherror("satips", "Unable to determine the HTTP/RTSP address");
return;
}
*
*/
int
-tcp_default_ip_addr ( struct sockaddr_storage *deflt )
+tcp_default_ip_addr ( struct sockaddr_storage *deflt, int family )
{
struct sockaddr_storage ss;
int sock;
memset(&ss, 0, sizeof(ss));
- ss.ss_family = tcp_preferred_address_family;
+ ss.ss_family = family == PF_UNSPEC ? tcp_preferred_address_family : family;
if (inet_pton(ss.ss_family,
ss.ss_family == AF_INET ?
/* Google name servers */
*
*/
int
-tcp_server_bound ( void *server, struct sockaddr_storage *bound )
+tcp_server_bound ( void *server, struct sockaddr_storage *bound, int family )
{
tcp_server_t *ts = server;
int i, len, port;
port = IP_PORT(ts->bound);
/* no bind address was set, try to find one */
- if (tcp_default_ip_addr(bound) < 0)
+ if (tcp_default_ip_addr(bound, family) < 0)
return -1;
if (bound->ss_family == AF_INET)
IP_AS_V4(*bound, port) = port;
void tcp_server_delete(void *server);
-int tcp_default_ip_addr(struct sockaddr_storage *deflt);
+int tcp_default_ip_addr(struct sockaddr_storage *deflt, int family);
-int tcp_server_bound(void *server, struct sockaddr_storage *bound);
+int tcp_server_bound(void *server, struct sockaddr_storage *bound, int family);
int tcp_read(int fd, void *buf, size_t len);