1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Ignore Zeroconf messages sent by ourselves

This commit is contained in:
Uwe L. Korn
2013-04-05 17:54:32 +02:00
parent 248a87ccce
commit 14af3aedd6

View File

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