xiaoxiang781216 commented on code in PR #18989:
URL: https://github.com/apache/nuttx/pull/18989#discussion_r3318438722


##########
net/devif/devif_poll.c:
##########
@@ -336,6 +336,22 @@ devif_poll_bluetooth_connections(FAR struct net_driver_s 
*dev,
   FAR struct bluetooth_conn_s *bluetooth_conn = NULL;
   int bstop = 0;
 
+  DEBUGASSERT(dev != NULL);
+
+  /* Bluetooth sockets must only be polled on Bluetooth radio devices.
+   * bluetooth_poll() treats the generic net_driver_s as a radio_driver_s,
+   * which is only valid for NET_LL_BLUETOOTH devices.  Without this guard,
+   * any active PF_BLUETOOTH socket causes every netdev poll, including PPP
+   * or TUN devices, to enter the Bluetooth poll path and corrupt that
+   * device's poll state.
+   */
+
+  if (dev->d_lltype != NET_LL_BLUETOOTH)

Review Comment:
   but only bluetooth netdev should poll with BLUETOOTH_POLL flag, why need 
check it's device type again?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to