diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp
index f80c6029ccf..1178780be96 100644
--- a/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp
+++ b/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp
@@ -125,11 +125,12 @@ void PDPListener::onNewCacheChangeAdded(
             {
                 // Create a new one when not found
                 pdata = parent_pdp_->createParticipantProxyData(temp_participant_data_, writer_guid);
+
+                reader->getMutex().unlock();
+                lock.unlock();
+
                 if (pdata != nullptr)
                 {
-                    reader->getMutex().unlock();
-                    lock.unlock();
-
                     logInfo(RTPS_PDP_DISCOVERY, "New participant "
                             << pdata->m_guid << " at "
                             << "MTTLoc: " << pdata->metatraffic_locators
diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp
index 5cb72c8837c..cf939930d8f 100644
--- a/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp
+++ b/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp
@@ -100,7 +100,6 @@ void PDPServerListener::onNewCacheChangeAdded(
         {
             change->instanceHandle = local_data.m_key;
             guid = local_data.m_guid;
-
             // At this point we can release reader lock.
             reader->getMutex().unlock();
 
@@ -152,7 +151,7 @@ void PDPServerListener::onNewCacheChangeAdded(
                 // Included for symmetry with PDPListener to profit from a future updateInfoMatchesEDP override
                 // right now servers update matching on clients that were previously relayed by a server
                 if ( previous_lease_check_status != pdata->should_check_lease_duration
-                        || parent_pdp_->updateInfoMatchesEDP() )
+                        || parent_pdp_->updateInfoMatchesEDP())
                 {
                     parent_pdp_->assignRemoteEndpoints(pdata);
                     parent_server_pdp_->queueParticipantForEDPMatch(pdata);
diff --git a/test/blackbox/BlackboxTestsDiscovery.cpp b/test/blackbox/BlackboxTestsDiscovery.cpp
index add7a5bc334..f8e9836640a 100644
--- a/test/blackbox/BlackboxTestsDiscovery.cpp
+++ b/test/blackbox/BlackboxTestsDiscovery.cpp
@@ -1025,4 +1025,4 @@ TEST(Discovery, ServerClientEnvironmentSetUp)
     output.clear();
     ASSERT_FALSE(load_environment_server_info(text, output));
 
-}
+}
\ No newline at end of file
diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt
index 08988537ec0..53cda8ff460 100644
--- a/test/blackbox/CMakeLists.txt
+++ b/test/blackbox/CMakeLists.txt
@@ -228,6 +228,8 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND)
             ${CMAKE_CURRENT_BINARY_DIR}/PubSubWriter.xml)
         configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PubSubReader.xml.in
             ${CMAKE_CURRENT_BINARY_DIR}/PubSubReader.xml)
+        configure_file(${CMAKE_CURRENT_SOURCE_DIR}/discovery_participant_flags.xml
+            ${CMAKE_CURRENT_BINARY_DIR}/discovery_participant_flags.xml)
 
         if(FASTRTPS_API_TESTS)
             set(BLACKBOXTESTS_FASTRTPS_SOURCE
diff --git a/test/blackbox/DDSBlackboxTestsDiscovery.cpp b/test/blackbox/DDSBlackboxTestsDiscovery.cpp
new file mode 100644
index 00000000000..470d3562aa9
--- /dev/null
+++ b/test/blackbox/DDSBlackboxTestsDiscovery.cpp
@@ -0,0 +1,55 @@
+// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <gtest/gtest.h>
+
+#include "BlackboxTests.hpp"
+
+#include "PubSubReader.hpp"
+
+// Regression test for redmine issue 11857
+TEST(DDSDiscovery, IgnoreParticipantFlags)
+{
+    // This participant is created with:
+    // - ignoreParticipantFlags = FILTER_SAME_PROCESS (will avoid discovery of p2)
+    // - metatrafficUnicastLocatorList = 127.0.0.1:7399, 127.0.0.1:7398 (to ensure two listening threads are created)
+    PubSubReader<HelloWorldType> p1(TEST_TOPIC_NAME);
+    p1.set_xml_filename("discovery_participant_flags.xml");
+    p1.set_participant_profile("participant_1");
+    p1.init();
+    EXPECT_TRUE(p1.isInitialized());
+
+    // This participant is created with initialPeersList = 127.0.0.1:7399
+    // When the announcements of this participant arrive to p1, they will be ignored, and thus p1 will not
+    // announce itself back to p2.
+    PubSubReader<HelloWorldType> p2(TEST_TOPIC_NAME);
+    p2.set_xml_filename("discovery_participant_flags.xml");
+    p2.set_participant_profile("participant_2");
+    p2.init();
+    EXPECT_TRUE(p2.isInitialized());
+    EXPECT_FALSE(p2.wait_participant_discovery(1, std::chrono::seconds(1)));
+    EXPECT_FALSE(p1.wait_participant_discovery(1, std::chrono::seconds(1)));
+
+    // This participant is created with:
+    // - initialPeersList = 127.0.0.1:7398
+    // - a custom guid prefix
+    // The announcements of this participant will arrive to p1 on a different listening thread.
+    // Due to the custom prefix, they should not be ignored, and mutual discovery should happen
+    PubSubReader<HelloWorldType> p3(TEST_TOPIC_NAME);
+    p3.set_xml_filename("discovery_participant_flags.xml");
+    p3.set_participant_profile("participant_3");
+    p3.init();
+    EXPECT_TRUE(p1.wait_participant_discovery());
+    EXPECT_TRUE(p3.wait_participant_discovery());
+}
\ No newline at end of file
diff --git a/test/blackbox/api/dds-pim/PubSubReader.hpp b/test/blackbox/api/dds-pim/PubSubReader.hpp
index 325f937d063..15970b826b8 100644
--- a/test/blackbox/api/dds-pim/PubSubReader.hpp
+++ b/test/blackbox/api/dds-pim/PubSubReader.hpp
@@ -434,13 +434,52 @@ class PubSubReader
         std::cout << "Reader discovery finished..." << std::endl;
     }
 
+    bool wait_participant_discovery(
+            unsigned int min_participants = 1,
+            std::chrono::seconds timeout = std::chrono::seconds::zero())
+    {
+        bool ret_value = true;
+        std::unique_lock<std::mutex> lock(mutexDiscovery_);
+
+        std::cout << "Reader is waiting discovery of at least " << min_participants << " participants..." << std::endl;
+
+        if (timeout == std::chrono::seconds::zero())
+        {
+            cvDiscovery_.wait(lock, [&]()
+                    {
+                        return participant_matched_ >= min_participants;
+                    });
+        }
+        else
+        {
+            if (!cvDiscovery_.wait_for(lock, timeout, [&]()
+                    {
+                        return participant_matched_ >= min_participants;
+                    }))
+            {
+                ret_value = false;
+            }
+        }
+
+        if (ret_value)
+        {
+            std::cout << "Reader participant discovery finished successfully..." << std::endl;
+        }
+        else
+        {
+            std::cout << "Reader participant discovery finished unsuccessfully..." << std::endl;
+        }
+
+        return ret_value;
+    }
+
     bool wait_participant_undiscovery(
             std::chrono::seconds timeout = std::chrono::seconds::zero())
     {
         bool ret_value = true;
         std::unique_lock<std::mutex> lock(mutexDiscovery_);
 
-        std::cout << "Reader is waiting undiscovery..." << std::endl;
+        std::cout << "Reader is waiting participant undiscovery..." << std::endl;
 
         if (timeout == std::chrono::seconds::zero())
         {
@@ -462,11 +501,11 @@ class PubSubReader
 
         if (ret_value)
         {
-            std::cout << "Reader undiscovery finished successfully..." << std::endl;
+            std::cout << "Reader participant undiscovery finished successfully..." << std::endl;
         }
         else
         {
-            std::cout << "Reader undiscovery finished unsuccessfully..." << std::endl;
+            std::cout << "Reader participant undiscovery finished unsuccessfully..." << std::endl;
         }
 
         return ret_value;
@@ -784,6 +823,13 @@ class PubSubReader
         return *this;
     }
 
+    PubSubReader& ignore_participant_flags(
+            eprosima::fastrtps::rtps::ParticipantFilteringFlags_t flags)
+    {
+        participant_qos_.wire_protocol().builtin.discovery_config.ignoreParticipantFlags = flags;
+        return *this;
+    }
+
     PubSubReader& socket_buffer_size(
             uint32_t sockerBufferSize)
     {
diff --git a/test/blackbox/discovery_participant_flags.xml b/test/blackbox/discovery_participant_flags.xml
new file mode 100644
index 00000000000..ff4d216972c
--- /dev/null
+++ b/test/blackbox/discovery_participant_flags.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"  ?>
+<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
+    <profiles>          
+
+        <participant profile_name="participant_1">
+            <rtps>
+                <name>Discovery.IgnoreParticipantFlags.p1</name>
+                
+                <builtin>
+                    <discovery_config>
+                        <ignoreParticipantFlags>FILTER_SAME_PROCESS</ignoreParticipantFlags>
+                    </discovery_config>
+                    <metatrafficUnicastLocatorList>
+                        <locator>
+                            <udpv4>
+                                <port>7399</port>
+                                <address>127.0.0.1</address>
+                            </udpv4>
+                        </locator>
+                        <locator>
+                            <udpv4>
+                                <port>7398</port>
+                                <address>127.0.0.1</address>
+                            </udpv4>
+                        </locator>
+                    </metatrafficUnicastLocatorList>
+                </builtin>
+            </rtps>
+        </participant>
+
+        <participant profile_name="participant_2">
+            <rtps>
+                <name>Discovery.IgnoreParticipantFlags.p2</name>
+                
+                <builtin>
+                    <initialPeersList>
+                        <locator>
+                            <udpv4>
+                                <port>7399</port>
+                                <address>127.0.0.1</address>
+                            </udpv4>
+                        </locator>
+                    </initialPeersList>
+                </builtin>
+            </rtps>
+        </participant>
+
+        <participant profile_name="participant_3">
+            <rtps>
+                <prefix>f0.f0.f0.f0.f0.f0.f0.f0.f0.f0.f0.f0</prefix>
+                <name>Discovery.IgnoreParticipantFlags.p3</name>
+                
+                <builtin>
+                    <initialPeersList>
+                        <locator>
+                            <udpv4>
+                                <port>7398</port>
+                                <address>127.0.0.1</address>
+                            </udpv4>
+                        </locator>
+                    </initialPeersList>
+                </builtin>
+            </rtps>
+        </participant>
+
+    </profiles>
+</dds>