Lines Matching +full:magic +full:- +full:packet
1 /* SPDX-License-Identifier: GPL-2.0 */
18 /* MCTP packet definitions */
79 * by sk->net->keys_lock
94 * - individual key data (ie, the struct itself) is protected by key->lock;
97 * - the lookup fields: peer_addr, local_addr and tag are set before the
100 * - A ref to the key must be held (throuh key->refs) if a pointer to the
101 * key is to be accessed after key->lock is released.
103 * - a mctp_sk_key contains a reference to a struct sock; this is valid
107 * - these mctp_sk_keys appear on two lists:
108 * 1) the struct mctp_sock->keys list
109 * 2) the struct netns_mctp->keys list
115 * netns_mctp->keys lock. Lookup functions will need to lock the key and
117 * keys_lock *cannot* be acquired with the individual key->lock held.
119 * - a key may have a sk_buff attached as part of an in-progress message
120 * reassembly (->reasm_head). The reasm data is protected by the individual
121 * key->lock.
123 * - there are two destruction paths for a mctp_sk_key:
125 * - through socket unhash (see mctp_sk_unhash). This performs the list
128 * - where a key is established to receive a reply message: after receiving
133 * - through an expiry timeout, on a per-socket timer
147 /* per-socket list */
184 unsigned int magic; member
192 /* skb control-block accessors with a little extra debugging for initial
195 * TODO: remove checks & mctp_skb_cb->magic; replace callers of __mctp_cb
198 * __mctp_cb() is only for the initial ingress code; we should see ->magic set
203 struct mctp_skb_cb *cb = (void *)skb->cb; in __mctp_cb()
205 cb->magic = 0x4d435450; in __mctp_cb()
211 struct mctp_skb_cb *cb = (void *)skb->cb; in mctp_cb()
213 BUILD_BUG_ON(sizeof(struct mctp_skb_cb) > sizeof(skb->cb)); in mctp_cb()
214 WARN_ON(cb->magic != 0x4d435450); in mctp_cb()
215 return (void *)(skb->cb); in mctp_cb()
227 * These are held in the pernet->mctp.routes list, with RCU protection for
263 /* routing <--> device interface */