diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2013-02-24 00:35:52 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2013-02-24 00:35:52 +0100 |
commit | 06d41e3eb782dc9d6d44477be0628bbce0e56297 (patch) | |
tree | 3dd1727559ffaba978b053cb8e451fbdceedb606 | |
parent | 92a1f540022559dbf2da644f65a08d8bb56a33fb (diff) | |
download | vdr-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-- | Makefile | 3 | ||||
-rw-r--r-- | pages/Makefile | 3 | ||||
-rw-r--r-- | setup.cpp | 13 | ||||
-rw-r--r-- | tntfeatures.h | 2 |
4 files changed, 15 insertions, 6 deletions
@@ -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: @@ -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 |