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:
@@ -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 ) )
|
||||||
|
Reference in New Issue
Block a user