diff --git a/libgssdp/gssdp-resource-browser.c b/libgssdp/gssdp-resource-browser.c
index b4ca354..3d88d36 100644
--- a/libgssdp/gssdp-resource-browser.c
+++ b/libgssdp/gssdp-resource-browser.c
@@ -91,6 +91,7 @@ typedef struct {
         GSSDPResourceBrowser *resource_browser;
         char                 *usn;
         GSource              *timeout_src;
+        char                 *location;
 } Resource;
 
 /* Function prototypes */
@@ -118,6 +119,9 @@ static void
 stop_discovery                   (GSSDPResourceBrowser *resource_browser);
 static gboolean
 refresh_cache                    (gpointer data);
+static void
+resource_unavailable             (GSSDPResourceBrowser *resource_browser,
+                                  SoupMessageHeaders   *headers);
 
 static void
 gssdp_resource_browser_init (GSSDPResourceBrowser *resource_browser)
@@ -660,6 +664,7 @@ resource_available (GSSDPResourceBrowser *resource_browser,
 {
         const char *usn;
         const char *header;
+        const char *location;
         Resource *resource;
         gboolean was_cached;
         guint timeout;
@@ -669,6 +674,7 @@ resource_available (GSSDPResourceBrowser *resource_browser,
         usn = soup_message_headers_get_one (headers, "USN");
         if (!usn)
                 return; /* No USN specified */
+        location = soup_message_headers_get_one (headers, "Location");
 
         if (resource_browser->priv->version > 0) {
                 char *version;
@@ -689,6 +695,12 @@ resource_available (GSSDPResourceBrowser *resource_browser,
                                   g_strdup (canonical_usn));
         }
 
+        /* If location does not match, expect that we missed bye bye packet */
+        if (resource && strcmp(resource->location, location) != 0) {
+                resource_unavailable(resource_browser, headers);
+                resource = NULL;
+        }
+
         if (resource) {
                 /* Remove old timeout */
                 g_source_destroy (resource->timeout_src);
@@ -700,6 +712,7 @@ resource_available (GSSDPResourceBrowser *resource_browser,
 
                 resource->resource_browser = resource_browser;
                 resource->usn              = g_strdup (usn);
+                resource->location         = g_strdup (location);
                 
                 g_hash_table_insert (resource_browser->priv->resources,
                                      canonical_usn,
@@ -1004,6 +1017,8 @@ resource_free (gpointer data)
 
         g_source_destroy (resource->timeout_src);
 
+        g_free (resource->location);
+
         g_slice_free (Resource, resource);
 }
 
diff --git a/tests/gtest/test-regression.c b/tests/gtest/test-regression.c
index a68e44c..680b68e 100644
--- a/tests/gtest/test-regression.c
+++ b/tests/gtest/test-regression.c
@@ -31,6 +31,7 @@
 #include <libgssdp/gssdp-resource-browser.h>
 #include <libgssdp/gssdp-resource-group.h>
 #include <libgssdp/gssdp-protocol.h>
+#include <stdio.h>
 
 #include "test-util.h"
 
@@ -248,6 +249,127 @@ void test_bgo682099 (void)
  * ============================================================================
  */
 
+/* BEGIN Regression test
+ * missed_bye_bye
+ * ============================================================================
+ * - Start a resource browser and send a two SSDP packets with different locations.
+ * - Check that there are 2 "resource-unavailable" signals.
+ * - Shut down the ResourceBrowser and assert that there is NO
+ *   "resource-unavailable" signal.
+ */
+#define UUID_MISSED_BYE_BYE_1 "uuid:81909e94-ebf4-469e-ac68-81f2f18816ac"
+#define USN_MISSED_BYE_BYE "urn:org-gupnp:device:RegressionTestMissedByeBye:2"
+#define USN_MISSED_BYE_BYE_1 "urn:org-gupnp:device:RegressionTestMissedByeBye:1"
+#define NT_MISSED_BYE_BYE_1 UUID_MISSED_BYE_BYE_1"::"USN_MISSED_BYE_BYE_1
+#define LOCATION_MISSED_BYE_BYE_1 "http://127.0.0.1:1234"
+#define LOCATION_MISSED_BYE_BYE_2 "http://127.0.0.1:1235"
+
+char *
+create_alive_message_missed_bye_bye (const char *location)
+{
+        char *msg;
+
+        msg = g_strdup_printf (SSDP_ALIVE_MESSAGE,
+                               5,
+                               location,
+                               "",
+                               "Linux/3.0 UPnP/1.0 GSSDPTesting/0.0.0",
+                               NT_MISSED_BYE_BYE_1,
+                               USN_MISSED_BYE_BYE_1);
+
+        return msg;
+}
+
+static gboolean
+announce_ressource_missed_bye_bye_1 (gpointer user_data)
+{
+        send_packet (create_alive_message_missed_bye_bye (LOCATION_MISSED_BYE_BYE_1));
+
+        return FALSE;
+}
+
+static gboolean
+announce_ressource_missed_bye_bye_2 (gpointer user_data)
+{
+        send_packet (create_alive_message_missed_bye_bye (LOCATION_MISSED_BYE_BYE_2));
+
+        return FALSE;
+}
+
+static void
+resource_availabe_missed_bye_bye_1 (GSSDPResourceBrowser *src,
+                               const char           *usn,
+                               GList                *locations,
+                               gpointer              user_data)
+{
+        g_assert_cmpstr (usn, ==, USN_MISSED_BYE_BYE_1);
+        g_assert_cmpstr ((const char *) locations->data, ==, LOCATION_MISSED_BYE_BYE_1);
+        g_main_loop_quit ((GMainLoop *) user_data);
+}
+
+static void
+resource_availabe_missed_bye_bye_2 (GSSDPResourceBrowser *src,
+                               const char           *usn,
+                               GList                *locations,
+                               gpointer              user_data)
+{
+        g_assert_cmpstr (usn, ==, USN_MISSED_BYE_BYE_1);
+        g_assert_cmpstr ((const char *) locations->data, ==, LOCATION_MISSED_BYE_BYE_2);
+        g_main_loop_quit ((GMainLoop *) user_data);
+}
+
+static void
+resource_unavailabe_missed_bye_bye (GSSDPResourceBrowser *src,
+                               const char           *usn,
+                               gpointer              user_data)
+{
+        g_assert_cmpstr (usn, ==, USN_MISSED_BYE_BYE_1);
+        g_main_loop_quit ((GMainLoop *) user_data);
+}
+
+void test_missed_bye_bye (void)
+{
+        GSSDPClient *dest;
+        GSSDPResourceBrowser *browser;
+        GError *error = NULL;
+        GMainLoop *loop;
+        gulong available_signal_id;
+
+        loop = g_main_loop_new (NULL, FALSE);
+
+        dest = gssdp_client_new (NULL, "lo", &error);
+        g_assert (dest != NULL);
+        g_assert (error == NULL);
+
+        browser = gssdp_resource_browser_new (dest, USN_MISSED_BYE_BYE_1);
+        available_signal_id = g_signal_connect (browser,
+                                      "resource-available",
+                                      G_CALLBACK (resource_availabe_missed_bye_bye_1),
+                                      loop);
+        g_signal_connect (browser,
+                                      "resource-unavailable",
+                                      G_CALLBACK (resource_unavailabe_missed_bye_bye),
+                                      loop);
+        gssdp_resource_browser_set_active (browser, TRUE);
+        g_timeout_add_seconds (2, announce_ressource_missed_bye_bye_1, NULL);
+        g_timeout_add_seconds (3, announce_ressource_missed_bye_bye_2, NULL);
+        g_main_loop_run (loop);  /* available */
+        g_signal_handler_disconnect (browser, available_signal_id);
+        available_signal_id = g_signal_connect (browser,
+                                      "resource-available",
+                                      G_CALLBACK (resource_availabe_missed_bye_bye_2),
+                                      loop);
+        g_main_loop_run (loop);  /* unavailable + available */
+        g_main_loop_run (loop);  /* unavailable */
+        unref_object(browser);
+}
+
+/* END Regression test
+ * missed_bye_bye
+ * ============================================================================
+ */
+
+
 int main (int argc, char *argv[])
 {
 #if !GLIB_CHECK_VERSION (2, 35, 0)
@@ -258,6 +380,7 @@ int main (int argc, char *argv[])
         if (g_test_slow ()) {
                g_test_add_func ("/bugs/gnome/673150", test_bgo673150);
                g_test_add_func ("/bugs/gnome/682099", test_bgo682099);
+               g_test_add_func ("/missed_bye_bye", test_missed_bye_bye);
         }
 
         g_test_run ();
