diff -ruN -x Make.config -x Makefile -x dvbdevice.h vdr-1.6.0-2.org/config.c vdr-1.6.0-2/config.c --- vdr-1.6.0-2.org/config.c 2008-02-17 14:39:00.000000000 +0100 +++ vdr-1.6.0-2/config.c 2010-01-09 18:32:22.626879490 +0100 @@ -121,6 +121,11 @@ return (Address & mask) == (addr.s_addr & mask); } +bool cSVDRPhost::IsLocalhost(void) +{ + return (addr.s_addr == htonl(INADDR_LOOPBACK)); +} + // --- cCommands ------------------------------------------------------------- cCommands Commands; @@ -141,6 +146,17 @@ return false; } +bool cSVDRPhosts::LocalhostOnly(void) +{ + cSVDRPhost *h = First(); + while (h) { + if (!h->IsLocalhost()) + return false; + h = (cSVDRPhost *)h->Next(); + } + return true; +} + // --- cSetupLine ------------------------------------------------------------ cSetupLine::cSetupLine(void) diff -ruN -x Make.config -x Makefile -x dvbdevice.h vdr-1.6.0-2.org/config.h vdr-1.6.0-2/config.h --- vdr-1.6.0-2.org/config.h 2010-01-09 18:45:11.477536875 +0100 +++ vdr-1.6.0-2/config.h 2010-01-09 18:29:36.565516740 +0100 @@ -73,6 +73,7 @@ cSVDRPhost(void); bool Parse(const char *s); bool Accepts(in_addr_t Address); + bool IsLocalhost(void); }; template class cConfig : public cList { @@ -164,6 +165,7 @@ class cSVDRPhosts : public cConfig { public: bool Acceptable(in_addr_t Address); + bool LocalhostOnly(void); }; extern cCommands Commands; diff -ruN -x Make.config -x Makefile -x dvbdevice.h vdr-1.6.0-2.org/svdrp.c vdr-1.6.0-2/svdrp.c --- vdr-1.6.0-2.org/svdrp.c 2010-01-09 18:45:11.535528281 +0100 +++ vdr-1.6.0-2/svdrp.c 2010-01-09 18:34:11.211458832 +0100 @@ -79,7 +79,7 @@ struct sockaddr_in name; name.sin_family = AF_INET; name.sin_port = htons(port); - name.sin_addr.s_addr = htonl(INADDR_ANY); + name.sin_addr.s_addr = SVDRPhosts.LocalhostOnly() ? htonl(INADDR_LOOPBACK) : htonl(INADDR_ANY); if (bind(sock, (struct sockaddr *)&name, sizeof(name)) < 0) { LOG_ERROR; Close();