Skip to content

Commit

Permalink
Log an error if we are unable to find IPv4 or IPv6 addresses, only
Browse files Browse the repository at this point in the history
exit if we are unable to find any address to bind to
  • Loading branch information
stuartm committed Oct 6, 2012
1 parent 7da754a commit 33d2b05
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mythtv/programs/mythbackend/mainserver.cpp
Expand Up @@ -257,12 +257,22 @@ MainServer::MainServer(bool master, int port,
#endif
QList<QHostAddress> listenAddrs = mythserver->DefaultListen();

#if !defined(QT_NO_IPV6)
if (v6IsSet && !listenAddrs.contains(config_v6))
LOG(VB_GENERAL, LOG_WARNING, "Unable to find IPv6 address to bind");
#endif

if (v4IsSet && !listenAddrs.contains(config_v4))
LOG(VB_GENERAL, LOG_WARNING, "Unable to find IPv4 address to bind");

if ((v4IsSet && !listenAddrs.contains(config_v4))
#if !defined(QT_NO_IPV6)
|| (v6IsSet && !listenAddrs.contains(config_v6))
&& (v6IsSet && !listenAddrs.contains(config_v6))
#endif
)
{
LOG(VB_GENERAL, LOG_ERR, "Unable to find either IPv4 or IPv6 "
"address we can bind to, exiting");
SetExitCode(GENERIC_EXIT_SOCKET_ERROR, false);
return;
}
Expand Down

0 comments on commit 33d2b05

Please sign in to comment.