summaryrefslogtreecommitdiff
path: root/setup.cpp
diff options
context:
space:
mode:
authorRolf Ahrenberg <Rolf.Ahrenberg@sci.fi>2011-02-22 00:32:30 +0200
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2011-02-22 00:42:07 +0100
commit118c2aa7306fba7481e619ef916e5ecc05577695 (patch)
treee65da8d3a1cec229c60553d2ae927d18e99d2de3 /setup.cpp
parent45ff354dd802a9994d676eafff14499fd91d1946 (diff)
downloadvdr-plugin-live-118c2aa7306fba7481e619ef916e5ecc05577695.tar.gz
vdr-plugin-live-118c2aa7306fba7481e619ef916e5ecc05577695.tar.bz2
Fixed interface binding on IPv4 only systems.
Diffstat (limited to 'setup.cpp')
-rw-r--r--setup.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/setup.cpp b/setup.cpp
index 08edcb4..4b47520 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -191,23 +191,24 @@ namespace {
bool Setup::CheckServerIps()
{
if ( m_serverIps.empty() ) {
- bool bindv6only = false;
FILE* f = fopen("/proc/sys/net/ipv6/bindv6only", "r");
if (f) {
+ bool bindv6only = false;
int c = fgetc(f);
if (c != EOF) {
bindv6only = c - '0';
}
fclose(f);
f = NULL;
+ esyslog( "[live] INFO: bindv6only=%d", bindv6only);
+ // add a default IPv6 listener address
+ m_serverIps.push_back( "::" );
+ // skip the default IPv4 listener address if IPv6 one will be binded also to v4
+ if (!bindv6only)
+ return true;
}
- esyslog( "[live] INFO: bindv6only=%d", bindv6only);
- cerr << "INFO: bindv6only=" << bindv6only << endl;
- // add a default IPv4 listener address if default IPv6 one
- // will be binded only to v6
- if (bindv6only)
- m_serverIps.push_back( "0.0.0.0" );
- m_serverIps.push_back( "::" );
+ // add a default IPv4 listener address
+ m_serverIps.push_back( "0.0.0.0" );
// we assume these are ok :)
return true;
}