Stephen-F commented on code in PR #18989:
URL: https://github.com/apache/nuttx/pull/18989#discussion_r3318640436


##########
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:
   You are correct. I can now see that the behavior changed in Commit c481374f 
and the d_polltype is now guarded by type in devif_poll_connections. The issue 
that triggered this PR should no longer be present in mainline and the change 
looks to be redundant and no longer required. Assuming you concur, I will close 
the PR.



-- 
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