aboutsummaryrefslogtreecommitdiffstats
path: root/src/zeroconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zeroconf.c')
-rw-r--r--src/zeroconf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zeroconf.c b/src/zeroconf.c
index 7b00789b6..4a399e4a2 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2010 The Music Player Daemon Project
+ * Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#include "zeroconf.h"
#include "zeroconf-internal.h"
#include "conf.h"
+#include "listen.h"
#include <glib.h>
@@ -42,6 +43,12 @@ void initZeroconf(void)
if (!zeroconfEnabled)
return;
+ if (listen_port <= 0) {
+ g_warning("No global port, disabling zeroconf");
+ zeroconfEnabled = false;
+ return;
+ }
+
serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME);
#ifdef HAVE_AVAHI