3 ms·
Clearly I'm missing something - in BadKarma, why does the compiler not baulk at sk_filter being passed a struct amp_mgr* instead of a struct sock* as expected?
by phab 6y ago
Clearly I'm missing something - in BadKarma, why does the compiler not baulk at sk_filter being passed a struct amp_mgr* instead of a struct sock* as expected? A type confusion like that ought to be prevented during typecheck, no?
- loeg 6y agoIt's indirected via `chan->data`, which is probably a `void*`. (Implicit) pointer casts between `void*` and other arbitrary types are allowed.
- phab 6y agoOf course, slow moment. Thanks. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/net/bluetooth/l2cap.h#n644 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...