Reduce code duplication.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
ok, so this stupid hack is because of something else - there's no locking around fetching and setting vap->iv_bss; and sometimes an invalid or NULL node shows up there. The hack (ni = ref(vap->iv_bss)) closes the window, but it's still there.
I'd rather we actually plan out and fix how the vap node lifecycle and refcounting happens, rather than what currently happens.
How this will help when vap->iv_bss will be changed / set to NULL before calling urtwn_ra_init()?
There's a small window around the time that the vap bss node gets changed in net80211. It's a small window, but people would hit it during scanning.
We should fix that and the locking first, otherwise we're still going to keep hitting issues. The refcounting isn't enough - it's atomic and done without locks but you can end up with node counters getting down to zero and then you get a reference to the node whilst it's being freed and then try incrementing the reference. It's all very racy.
If there is no possibility to use usbd_do_request*() without sleeping, then this will be a bit complicated (revert this part for now).