summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2013-02-23 23:35:52 (GMT)
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2013-02-23 23:35:52 (GMT)
commit06d41e3eb782dc9d6d44477be0628bbce0e56297 (patch)
tree3dd1727559ffaba978b053cb8e451fbdceedb606
parent92a1f540022559dbf2da644f65a08d8bb56a33fb (diff)
downloadvdr-plugin-live-06d41e3eb782dc9d6d44477be0628bbce0e56297.tar.gz
vdr-plugin-live-06d41e3eb782dc9d6d44477be0628bbce0e56297.tar.bz2
Fix listener bug triggered by never versions of cxxtools reported in bug #1066
-rw-r--r--Makefile3
-rw-r--r--pages/Makefile3
-rw-r--r--setup.cpp13
-rw-r--r--tntfeatures.h2
4 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index af04aa8..ab2f2b5 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,7 @@ TMPDIR ?= /tmp
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
I18NTARG = $(shell if [ `echo $(APIVERSION) | tr [.] [0]` -ge "10507" ]; then echo "i18n"; fi)
TNTVERSION = $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }')
+CXXTOOLVER = $(shell cxxtools-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }')
TNTVERS7 = $(shell ver=$(TNTVERSION); if [ $$ver -ge "1606" ]; then echo "yes"; fi)
CXXFLAGS += $(shell tntnet-config --cxxflags)
@@ -73,7 +74,7 @@ ifneq ($(TNTVERS7),yes)
LIBS += httpd/libhttpd.a
endif
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION)
+DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION) -DCXXTOOLVER=$(CXXTOOLVER)
SUBDIRS = pages css javascript
ifneq ($(TNTVERS7),yes)
diff --git a/pages/Makefile b/pages/Makefile
index 9a1129c..78a4a9c 100644
--- a/pages/Makefile
+++ b/pages/Makefile
@@ -5,6 +5,7 @@ PLUGIN = live
### Additional options to silence TNTNET warnings
TNTFLAGS ?= -Wno-overloaded-virtual -Wno-unused-variable
TNTVERSION ?= $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }')
+CXXTOOLVER ?= $(shell cxxtools-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }')
### The C++ compiler and options:
@@ -13,7 +14,7 @@ AR ?= ar
ECPPC ?= ecppc
CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC
-DEFINES ?= -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION)
+DEFINES ?= -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION) -DCXXTOOLVER=$(CXXTOOLVER)
### The directory environment:
diff --git a/setup.cpp b/setup.cpp
index bd72e92..f6bf168 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -189,26 +189,31 @@ namespace {
bool Setup::CheckServerIps()
{
if ( m_serverIps.empty() ) {
+#if TNT_IPV6_V6ONLY
+ m_serverIps.push_back("");
+ return true;
+#else
FILE* f = fopen("/proc/sys/net/ipv6/bindv6only", "r");
if (f) {
bool bindv6only = false;
int c = fgetc(f);
if (c != EOF) {
- bindv6only = c - '0';
+ bindv6only = ((c - '0') != 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
+ m_serverIps.push_back("::");
+ // skip the default IPv4 listener address if the IPv6 one will be bound also to v4
if (!bindv6only)
return true;
}
// add a default IPv4 listener address
- m_serverIps.push_back( "0.0.0.0" );
+ m_serverIps.push_back("0.0.0.0");
// we assume these are ok :)
return true;
+#endif // TNT_IPV6_V6ONLY
}
IpList::iterator i = partition(m_serverIps.begin(), m_serverIps.end(), IpValidator());
diff --git a/tntfeatures.h b/tntfeatures.h
index fb5d9c5..6de1f88 100644
--- a/tntfeatures.h
+++ b/tntfeatures.h
@@ -23,5 +23,7 @@
// new version of TNTNET allow the request watchdog to be silenced.
#define TNT_WATCHDOG_SILENCE (TNTVERSION >= 16900)
+// version of TNTNET that binds ipv6 addresses with IPV6_V6ONLY flag set to true
+#define TNT_IPV6_V6ONLY (CXXTOOLVER >= 21000)
#endif // VDR_LIVE_TNTFEATURES_H