From 698bd23a9cc2755005bbb26694ce2470de874e27 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 3 Nov 2020 23:08:12 +0000 Subject: [PATCH] Disallow sending UDP Message Protocol traffic to broadcast address --- Network/MessageClient.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Network/MessageClient.cpp b/Network/MessageClient.cpp index 57ffb2806..3474f19bb 100644 --- a/Network/MessageClient.cpp +++ b/Network/MessageClient.cpp @@ -148,6 +148,13 @@ void MessageClient::impl::start () return; } + if (is_broadcast_address (server_)) + { + Q_EMIT self_->error ("IPv4 broadcast not supported, please specify the loop-back address, a server host address, or multicast group address"); + pending_messages_.clear (); // discard + return; + } + if (blocked_addresses_.end () != std::find (blocked_addresses_.begin (), blocked_addresses_.end (), server_)) { Q_EMIT self_->error ("UDP server blocked, please try another"); @@ -181,13 +188,6 @@ void MessageClient::impl::start () } } - if (server_.isBroadcast ()) - { - // only allow broadcast on the loopback interface to avoid - // flooding the local subnet which may be large with some ISPs - //interface_ip.setAddress ("127.0.0.1"); - } - if (localAddress () != interface_ip) { if (UnconnectedState != state () || state ())