From 14af3aedd6af9a96f4e0f6990d6dacc13c6d2112 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwelk@xhochy.com>
Date: Fri, 5 Apr 2013 17:54:32 +0200
Subject: [PATCH] Ignore Zeroconf messages sent by ourselves

---
 src/accounts/zeroconf/TomahawkZeroconf.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/accounts/zeroconf/TomahawkZeroconf.h b/src/accounts/zeroconf/TomahawkZeroconf.h
index c1d362fb4..afc7b36c5 100644
--- a/src/accounts/zeroconf/TomahawkZeroconf.h
+++ b/src/accounts/zeroconf/TomahawkZeroconf.h
@@ -29,6 +29,7 @@
 #include <QList>
 #include <QHostAddress>
 #include <QHostInfo>
+#include <QNetworkInterface>
 #include <QNetworkProxy>
 #include <QUdpSocket>
 #include <QTimer>
@@ -131,6 +132,10 @@ private slots:
         m_sock.readDatagram( datagram.data(), datagram.size(), &sender, &senderPort );
         qDebug() << "DATAGRAM RCVD" << QString::fromLatin1( datagram ) << sender;
 
+        // Ignore our own requests
+        if ( QNetworkInterface::allAddresses().contains( sender ) )
+            return;
+
         // only process msgs originating on the LAN:
         if ( datagram.startsWith( "TOMAHAWKADVERT:" ) &&
             Servent::isIPWhitelisted( sender ) )