device: Restart temporary timer while connecting
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 17 Aug 2023 22:31:08 +0000 (15:31 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
If the device is temporary restart its timer when attempt to connect to
it since it can interrupt the connection attempt prematurely while it
still scanning, etc.

src/device.c

index 5f504a6b1ae2fda8f05d53667ef2d947b1dcd4fb..41d2d3387c025bb748cf0c1517174ee2feb4dda2 100644 (file)
@@ -8820,6 +8820,10 @@ int device_connect_le(struct btd_device *dev)
        /* Keep this, so we can cancel the connection */
        dev->att_io = io;
 
+       /* Restart temporary timer to give it time to connect/pair, etc. */
+       if (dev->temporary)
+               set_temporary_timer(dev, btd_opts.tmpto);
+
        return 0;
 }