memset(&cp, 0, sizeof(cp));
 
        /* Update random address, but set require_privacy to false so
-        * that we never connect with an unresolvable address.
+        * that we never connect with an non-resolvable address.
         */
        if (hci_update_random_address(req, false, &own_addr_type))
                return;
 
        }
 
        /* In case of required privacy without resolvable private address,
-        * use an unresolvable private address. This is useful for active
+        * use an non-resolvable private address. This is useful for active
         * scanning and non-connectable advertising.
         */
        if (require_privacy) {
-               bdaddr_t urpa;
+               bdaddr_t nrpa;
 
-               get_random_bytes(&urpa, 6);
-               urpa.b[5] &= 0x3f;      /* Clear two most significant bits */
+               while (true) {
+                       /* The non-resolvable private address is generated
+                        * from random six bytes with the two most significant
+                        * bits cleared.
+                        */
+                       get_random_bytes(&nrpa, 6);
+                       nrpa.b[5] &= 0x3f;
+
+                       /* The non-resolvable private address shall not be
+                        * equal to the public address.
+                        */
+                       if (bacmp(&hdev->bdaddr, &nrpa))
+                               break;
+               }
 
                *own_addr_type = ADDR_LE_DEV_RANDOM;
-               set_random_addr(req, &urpa);
+               set_random_addr(req, &nrpa);
                return 0;
        }
 
        u8 filter_policy;
 
        /* Set require_privacy to false since no SCAN_REQ are send
-        * during passive scanning. Not using an unresolvable address
+        * during passive scanning. Not using an non-resolvable address
         * here is important so that peer devices using direct
         * advertising with our address will be correctly reported
         * by the controller.
 
 
                /* All active scans will be done with either a resolvable
                 * private address (when privacy feature has been enabled)
-                * or unresolvable private address.
+                * or non-resolvable private address.
                 */
                err = hci_update_random_address(req, true, &own_addr_type);
                if (err < 0) {