diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-08 03:54:28 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-08 18:51:34 +0200 |
commit | 2ae6cad8f509759e6ce8ca4e8a6c18ea5aabc605 (patch) | |
tree | 0c2b5d6796e2593e0fec676089f444707cd66035 /src/queueing.h | |
parent | 1027c1fb4493130ed9df96fd4092c4bf9c599b82 (diff) |
global: more nits
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/queueing.h')
-rw-r--r-- | src/queueing.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/queueing.h b/src/queueing.h index 281d325..ce522d8 100644 --- a/src/queueing.h +++ b/src/queueing.h @@ -61,8 +61,8 @@ struct packet_cb { u8 ds; }; -#define PACKET_PEER(skb) (((struct packet_cb *)skb->cb)->keypair->entry.peer) -#define PACKET_CB(skb) ((struct packet_cb *)skb->cb) +#define PACKET_CB(skb) ((struct packet_cb *)((skb)->cb)) +#define PACKET_PEER(skb) (PACKET_CB(skb)->keypair->entry.peer) /* Returns either the correct skb->protocol value, or 0 if invalid. */ static inline __be16 wg_skb_examine_untrusted_ip_hdr(struct sk_buff *skb) @@ -83,6 +83,7 @@ static inline __be16 wg_skb_examine_untrusted_ip_hdr(struct sk_buff *skb) static inline void wg_reset_packet(struct sk_buff *skb) { const int pfmemalloc = skb->pfmemalloc; + skb_scrub_packet(skb, true); memset(&skb->headers_start, 0, offsetof(struct sk_buff, headers_end) - @@ -166,6 +167,7 @@ static inline void wg_queue_enqueue_per_peer(struct crypt_queue *queue, * peer can be freed from below us. */ struct wg_peer *peer = wg_peer_get(PACKET_PEER(skb)); + atomic_set_release(&PACKET_CB(skb)->state, state); queue_work_on(wg_cpumask_choose_online(&peer->serial_work_cpu, peer->internal_id), @@ -181,6 +183,7 @@ static inline void wg_queue_enqueue_per_peer_napi(struct crypt_queue *queue, * peer can be freed from below us. */ struct wg_peer *peer = wg_peer_get(PACKET_PEER(skb)); + atomic_set_release(&PACKET_CB(skb)->state, state); napi_schedule(&peer->napi); wg_peer_put(peer); |